• Post Reply Bookmark Topic Watch Topic
  • New Topic

Threading EJB's  RSS feed

 
roul ravashimka
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

are all EJB's handled by one thread, or does every EJB has it's one thread?
Thanks,
Roul
 
Kyle Brown
author
Ranch Hand
Posts: 3892
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In most application servers, the answer is neither one. There is a thread pool that handles requests -- as a request comes in it's assigned to a thread from the thread pool. Now, each EJB from the EJB pool will only be assigned to one thread from the thread pool at a time, though...
Kyle
 
roul ravashimka
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks Kyle,
And if we would use a service locator, the method getInstance() and the cache must be synchronised, because all the threads use the same service locator.
Do you agree?
Thanks,
Roul
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!