Can I use Threads in a enterprise bean?

Aravind Naidu

No. The thread management is done by the container for you. As a bean developer you are not allowed to use threads.

Section 18.1.2 of the EJB 1.1 specification states:

  • The enterprise bean must not attempt to manage threads. The enterprise bean must not attempt to start, stop, suspend, or resume a thread; or to change a thread’s priority or name. The enter-prise bean must not attempt to manage thread groups.

These functions are reserved for the EJB Container. Allowing the enterprise bean to manage threads would decrease the Container’s ability to properly manage the runtime environment.

Related FAQs:
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

About | Sitemap | Contact