Are enterprise beans allowed to use Thread.sleep()?

Xavier Schaefer

Here is the answer from the Java 2 Enterprise Edition Developer's Guide (v. 1.2.1) :

"Enterprise beans make use of the services provided by the EJB container, such as life-cycle management. To avoid conflicts with these services, enterprise beans are restricted from performing certain operations:

  • ...
  • Managing or synchronizing threads
  • ...
  • "