[jboss-user] [EJB 3.0] - Timer cancled during timeout execution

cpslo1999 do-not-reply at jboss.com
Thu May 21 14:11:56 EDT 2009


I'm using an EJB3 style Stateless Session Bean as a target for a timer. During my integration testing I have the timer turned up to repeat very quickly (100ms interval) so that I don't have to wait for too long while the tests are executing. However, it has illustrated a problem that may have taken a really long time to witness (in fact I may never have witnessed it).

My test configures the timer to run on a tight interval, calls a method that starts the timer, does some checking to make sure the timer has done its job, and then cancels the timer. However, the test frequently cancels the timer while the handleTimeout method is executing. I know this, because I check to see if the Timer is valid at the beginning of the method, but toward the end of the method I get an exception when I call Timer.getInfo

10:56:12,890 ERROR [TimerImpl] Error invoking ejbTimeout ejb.NoSuchObjectLocalException: Timer was canceled

Being in a session bean, I had assumed that the public methods, including the @Timeout public void handleTimeout(Timer tmr) method would be transactional and therefore wouldn't interfere with each other like this.

Am I doing something wrong or is there a bug here?

View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4232558#4232558

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4232558



More information about the jboss-user mailing list