Hi I am writing an Arquillian Persistence Test and I am trying to manually
begin and commit a transaction. Something like:

@Test
@UsingDataSet("datasets/movies-with-version.yml")
public void test() throws Exception {
    userTransaction.begin();
    Movie movie = moviesService.findMovieById(1L);

But when I run the test I get an exception:

javax.transaction.NotSupportedException: Nested Transactions are not
supported
  at
org.apache.geronimo.transaction.manager.TransactionManagerImpl.begin(TransactionManagerImpl.java:157)
  at
org.apache.geronimo.transaction.manager.TransactionManagerImpl.begin(TransactionManagerImpl.java:152)
  at
org.apache.openejb.core.CoreUserTransaction.begin(CoreUserTransaction.java:55)
  at
com.scytl.hibernate.MoviesServiceTest.shouldThrowAnOptimisticLockingException(MoviesServiceTest.java:192)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
  at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  at java.lang.reflect.Method.invoke(Method.java:483)
  at
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
  at
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
  at
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
  at org.jboss.arquillian.junit.Arquillian$8$1.invoke(Arquillian.java:370)
  at
org.jboss.arquillian.container.test.impl.execution.LocalTestExecuter.execute(LocalTestExecuter.java:60)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
  at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  at java.lang.reflect.Method.invoke(Method.java:483)

Note that I am using Embedded adapter so the openejb arquillian transaction
API is not used.

Is this normal? Can I make something to work with this?

Thank you so much.

Reply via email to