Can I use Threads in a enterprise bean?
Created May 4, 2012
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:
Related FAQs:
- 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 threads 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 Containers ability to properly manage the runtime environment.