• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Can we use thread in ejbs ?

 
Vikas Kumar Sahu
Ranch Hand
Posts: 59
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 425
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
adrian mills
Ranch Hand
Posts: 63
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 39
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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)
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic