Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

using a Thread.sleep() in a MDB (inMDB or Stateless bean)

843830Oct 17 2005 — edited Oct 19 2005
Hi,

I have seen some of the previous threads about calling the Thread.sleep() within an EJB. They all seem to say that its a bad idea to do so.

But since Sateless Session Beans (and MDBs) are not passivated, I dont see why calling a Thread.sleep() would be harmful ?

I need to make a method in an MDB to keep checking the DB for an event at regular intervals. And to reduce the DB-lookup overhead, I I have to use Thread.sleep() between the DB-lookups.

So, Is calling Thread.sleep() is a bad idea (i.e in a MDB or stateless bean)?

Thanks.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 16 2005
Added on Oct 17 2005
4 comments
396 views