tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Romain Manni-Bucau <rmannibu...@gmail.com>
Subject Re: openEJB fail on second test
Date Tue, 21 Feb 2012 08:22:29 GMT
Hi,

can you compare what you are doing with the @Test method of the following
test please:

http://svn.apache.org/repos/asf/openejb/trunk/openejb/container/openejb-core/src/test/java/org/apache/openejb/core/stateful/StatefulJPATest.java

this test passes.

do you inject the stateful in your bean?

- Romain


2012/2/21 amber <amber63@hotmail.fr>

>
> I have another minor issue :
>
>
> The EJB is marked
> "@TransactionAttribute(TransactionAttributeType.REQUIRED)"
> so a create/update action is done inside a transaction
>
> I can trace it : DEBUG [Transaction] TX Required: Started transaction
> org.apache.geronimo.transaction.manager.TransactionImpl@26a150e
>
> ... and all work fine..
>
> but... i have one test fail : the remove operation !
>
> javax.persistence.TransactionRequiredException
> at
>
> org.apache.openejb.persistence.JtaEntityManager.assertTransactionActive(JtaEntityManager.java:91)
> at
>
> org.apache.openejb.persistence.JtaEntityManager.remove(JtaEntityManager.java:140)
> at
> org.foo.services.foo.impl.FooServiceBean.deleteFoo(FooServiceBean.java:84)
> at
>
> org.foo.services.foo.FooServiceBeanTest.deleteFoo(FooServiceBeanTest.java:126)
>
> I have to use the trick :
>
>                getTransactionalCaller().call(new Callable() {
>                        public Object call() throws Exception {
>                                ... the code ...
>                                return null;
>                        }
>                });
>
> and the remove() works... Why I have to do that only on the remove
> operation
> and not others ?
>
>
> thanks! and pardon me if my questions are trivials :)
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/openEJB-fail-on-second-test-tp4401889p4406177.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message