Because timers are persistent objects, a timer that has not yet expired will survive a container crash or application server shutdown. The handling of timers that expire during server shutdowns is application server specific. For example GlassFish will not attempt at startup to retrospectively invoke the bean's timeout callback method for timers that expired during shutdown.
The createTimer()
method executes in the scope of the executing method. If the transaction rolls back, then the container will undo the timer creation.
If a method cancels a timer within a transaction, and the transaction is rolled back, then the container will roll back the timer cancellation.
A timeout callback method may have a transaction attribute of REQUIRES_NEW
or REQUIRED
. If REQUIRED
is specified as a transaction attribute, the container will start a new transaction in any case. So a REQUIRED
attribute has exactly the same behavior as a REQUIRES_NEW
attribute. This is done so that a method...