• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
reply
    Bookmark Topic Watch Topic
  • New Topic