Forums Register Login

J2EE and threads

+Pie Number of slices to send: Send
So I have heard that you cannot (or should not) spawn your own threads when using EJBs. I don't use EJBs but I have also heard that you should not spawn your own threads when using J2EE. Is that true? We should let the container manage threads? If so, then how would one accomplish writing a multi-threaded app? Thanks
+Pie Number of slices to send: Send
 

Andy Hahn wrote:So I have heard that you cannot (or should not) spawn your own threads when using EJBs. I don't use EJBs but I have also heard that you should not spawn your own threads when using J2EE. Is that true? We should let the container manage threads? If so, then how would one accomplish writing a multi-threaded app? Thanks



In theory, you should not start any threads in J2EE. In practice, I see this all the time, particularly in servlets.

Henry
What a show! What atmosphere! What fun! What a tiny ad!
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 937 times.
Similar Threads
Observer pattern notifyAll () -- is it blocking?
Error in log: ...have started a TimerThread named
cant shutdown tomcat
Handling Uploaded Files
Doing IO operations in a Session Bean
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 13:23:44.