wood burning stoves 2.0*
The moose likes EJB and other Java EE Technologies and the fly likes Can we use thread in ejbs ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Can we use thread in ejbs ?" Watch "Can we use thread in ejbs ?" New topic
Author

Can we use thread in ejbs ?

Vikas Kumar Sahu
Ranch Hand

Joined: Dec 02, 2003
Posts: 59
Hi java Gurus,
Can we use threads in session bean.
Actually I have to launch n threads and have processing logic for diffrent devices.
Or can we do in other way instead of multithreading.

Thnax in advance
Vikas Kumar Sahu
Rahul Juneja
Ranch Hand

Joined: Aug 03, 2002
Posts: 425
Hi Vikas,

Threads are not permitted in EJB according to the EJB Sepcs. but if any server permits that that is purely not following the specs.

And regarding the alternative what is ur requirement can u be a more brief on that, if I could help you.

Cheers,
Rahul Juneja


Rahul Juneja
ThoughtClicks - http://techlabs.thoughtclicks.com
adrian mills
Ranch Hand

Joined: Dec 09, 2004
Posts: 63
Ya Vikas according to the ejb specification threads are not permitted in ejb.
It is the container which takes care of all such issues.
So if u are using an App server which is according to the ejb specification u need not worry about threading.
Also if u have any specific requirement please tell where u would like to use threading.
Gabriel Buheler
Ranch Hand

Joined: Apr 21, 2004
Posts: 39
It is said not to use threds. No comment on that.

As an alternative approach I can suggest using Message-Driven Beans instead.

There are several characteristicts the way you can develop it. Depends on your business logic.

Good luck!

Gabriel
(SCJP, SCWCD, pursuing SCBCD)
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Can we use thread in ejbs ?
 
Similar Threads
Servlets
combining servlets and sockets
When to use Threads
Can we use user defined threads in EJB. If not then why?
Can we use Threads in a Scriplet