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,
subject: Sun Server, MDB and timer service: timeout always called in single thread?