Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Number of EJBObjects

 
Saurav Chatterjee
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
I am looking up for the component interface from my servlet. Means that part of the code can be executed by many threads. I am using stateless session bean.
Now say there are 2 sessions and 3 threads. 2 belongs to 1 client and another 1 to another client.
My question is that in this situation how many EJBObjects will be created?
Regards,
Saurav
 
Annie Smith
Ranch Hand
Posts: 172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Refer to Ed Roman - Mastering EJB2 page 48

Some containers can have a 1:N relationship, where each EJB object is multithreaded (just like home objects). Other containers might have an M:N relationship, where M represents the number of EJB objects instantiated (and corresponds exactly to the number of clients currently connected), and N represents the number of bean instances in the pool.

IIRC, a 1:1 relationship is maintained by most containers.
 
Saurav Chatterjee
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks and sorry for the delay....
Basically thats the relation between EJBObject and bean(if I got it right).
But I wanted to know what will be the relation between client and ejbobject?
Head first EJB says the relatio is 1:1. But I wonder what will be the case in case of threaded applications.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic