cancel
Showing results for 
Search instead for 
Did you mean: 

EJB3 TimerService lock-up

Former Member
0 Kudos

Hi.

I have a SLSB which creates 2 timers whenever it is initialised. This call is made from a ServletContextListener to create timers on startup.

Each timer is packed with serialized information on how they should behave, which is parsed whenever the @Timeout method is called.

I am noticing some bizarre behaviour:

1) Sometimes only one timer will fire.

2) At the end of each @Timeout method, the timer will get a list of the timers - at this point the application just stops processing and waits. For what, im not sure.

It prevents the application from being stopped / undeployed / running.

Is there any reason why TimerService.getTimers() would cause this?

Regards,

Andrew

Accepted Solutions (1)

Accepted Solutions (1)

former_member193379
Active Contributor
0 Kudos

Morton,

An enterprise bean usually creates a timer within a transaction. If this transaction is rolled back, the timer creation is also rolled back. Similarly, if a bean cancels a timer within a transaction that gets rolled back, the timer cancellation is rolled back. In this case, the timer's duration is reset as if the cancellation had never occurred.

Thanks,

Hamendra

Answers (0)