• Post Reply Bookmark Topic Watch Topic
  • New Topic

threading in ejb  RSS feed

 
pvsr rao
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
is EJB Component is multithreaded or singlethreaded
 
Georgy Bolyuba
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This really depends on type of EJB.

Session beans method can be excuted by one thread at given time.

Only one Statefull session bean can be executed at given time.

Several methods of stateless session bean can be executed at given time.
 
Geoffrey Falk
Ranch Hand
Posts: 171
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Depends how you interpret the question..

An EJB container such as an app server is a multithreaded Java application. It uses multiple threads to serve multiple requests at a time.

However -

It is usually a bad idea to work with threads from your own J2EE code. So any EJB code you write should not look like multithreaded code.

Application servers manage resources internally, and if you start creating threads in your own code, you will mess up that resource management.

Hope this answers your question,
Geoffrey
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!