EJB with thread is banned?

S

Shinya Koizumi

Can i use the thread in statefull sessoin bean?
I heard it is not good practice.

Does any happen to know why?

SK
 
A

Adam Maass

Shinya Koizumi said:
Can i use the thread in statefull sessoin bean?
I heard it is not good practice.

Does any happen to know why?

The container then can't manage all of the threading.

-- Adam Maass
 
P

Paul Hamaker

The EJB Specification says, under '21.1.2 Programming Restrictions' :
"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 enterprise 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."
So it's not only just not good practice.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top