*
The moose likes EJB and other Java EE Technologies and the fly likes Sun Server, MDB and timer service: timeout always called in single thread? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Sun Server, MDB and timer service: timeout always called in single thread?" Watch "Sun Server, MDB and timer service: timeout always called in single thread?" New topic
Author

Sun Server, MDB and timer service: timeout always called in single thread?

Mark Citizen
Greenhorn

Joined: Feb 16, 2006
Posts: 2
Hello,

I created an MDB bean which implements TimedObject interface (ejbTimeout method). The pool size is 16, so 16 bean instances are created when server starts up. The onMessage method of the bean creates new timer, set to execute once (after 10 seconds initial delay).
After the timer is created (still in onMessage method) I block the current thread for 20 seconds.

Based on the log file output I can tell that ejbTimeout is not executed until the blocking thread returns. Even though there are 15 beans remaining in the pool, timer service is executed on the same bean instance that created it, so the thread waits 20 seconds to execute 10 second timeout.

Is this supposed to work like that? Are there any settings I can change to make the timer service pick another MDB from the pool, without waiting?
Or is this part of the EJB specification?

I would appreciate if someone could clarify this for me. A verbose response would be best - I'm a little confused after running this test on how the timer service is supposed to work.
Thank you for your help,

Mark
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Sun Server, MDB and timer service: timeout always called in single thread?
 
Similar Threads
Strange behaviour of MDB and EJB
Timers question
EJB Timer Services Query
EJB timeout issue
controlling ejbTimeout EJB 2.1