Hi Isnt it already a tx associated to this method - you can check OpenEJB.getTransactionManager().getTransaction() value?
Romain Manni-Bucau @rmannibucau <https://twitter.com/rmannibucau> | Blog <http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> | LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber <http://www.tomitribe.com> 2015-03-16 15:29 GMT+01:00 Alex Soto <[email protected]>: > 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. >
