No, you can see source code here:
https://github.com/Scytl/jpaguide/blob/master/sources/hibernate-example/src/test/java/com/scytl/hibernate/MoviesServiceTest.java#L190

El dt., 17 març, 2015 a les 9:55, Romain Manni-Bucau (<[email protected]>)
va escriure:

> so it is already started, why you have this issue, no @Transactional?
>
>
> 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-17 9:34 GMT+01:00 Alex Soto <[email protected]>:
>
> > This is the value hehehehe
> > org.apache.geronimo.transaction.manager.TransactionImpl@6581bb9a
> >
> > El dt., 17 març, 2015 a les 9:28, Romain Manni-Bucau (<
> > [email protected]>)
> > va escriure:
> >
> > > And transaction is not null?
> > > Le 17 mars 2015 09:15, "Alex Soto" <[email protected]> a écrit :
> > >
> > > > It returns a GeronimoTransactionManager instance. I have modified the
> > > code
> > > > as:
> > > >
> > > > @Test
> > > > @UsingDataSet("datasets/movies-with-version.yml")
> > > > public void test() throws Exception {
> > > >     Transaction transaction =
> > > > OpenEJB.getTransactionManager().getTransaction();
> > > >     userTransaction.begin();
> > > >     Movie movie = moviesService.findMovieById(1L);
> > > >
> > > >
> > > >
> > > > El dl., 16 març, 2015 a les 18:41, Romain Manni-Bucau (<
> > > > [email protected]>) va escriure:
> > > >
> > > > > 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.shouldThrowAnOptimisticLocking
> > > > > Exception(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