users@glassfish.java.net

Re: @Schedule and @TransactionAttribute(NEVER) not compatible

From: <forums_at_java.net>
Date: Tue, 4 Sep 2012 09:52:25 -0500 (CDT)

Well the EJB 3.1 spec says: "18.2.8 Transactions An enterprise bean typically
creates a timer within the scope of a transaction. If the transaction is then
rolled back, the timer creation is rolled back. An enterprise bean typically
cancels a timer within a transaction. If the transaction is rolled back, the
container rescinds the timer cancellation. *A timeout callback method on a
bean with container-managed transactions has transaction attribute REQUIRED
or REQUIRES_NEW* (Required or RequiresNew if the deployment descriptor is
used to specify the transaction attribute). If the container-managed
transaction is rolled back, the container retries the timeout." So, even if I
don't understand the reason for this paragraph in the spec, I guess it's
normal. My work-around will be to make the transactions bean managed in the
FrontSigleton EJB.

--
[Message sent by forum member 'gquintana']
View Post: http://forums.java.net/node/889830