• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

stateless bean pooling

 
Murthy Cherukumilli
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
in case where the container decides to have a pool of stateless bean objects then there is a possibility that the container will create the beans and set them up in the pool. and the clients are associated with the bean when the client makes a method call.

but as a client when i have to access the object then i have to first do JNDI look up and then using the home object stub i call the create method then get the instance of the bean. so, in this case what is happenning when we make a method call create on the home object? would my ejbCreate be called ?
 
Bahadar Khan
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Murthy,

When you download Home proxy stub, then all the communication you do is with the Home Interface. When you issue ejbCreate(), then what actually happens is that Application container, creates EJBObject and picks one of the bean instances from the pool and assigns it to it. Afterwards, this EJBObject proxy stub is sent to the client and client can issue business methods on that bean. In most of the cases the container has sufficient quanitity of bean instances in the pool and its matter of assigning EJBobject with that bean. This rest of the course of actions change depending on the type of the bean, whether it is stateful or stateless. But this doesn't apply to enity beans as ejbCreate() in that case is actually creating a data row in the underlying database ( or storage medium ). So it has different roles in different scenarios.
 
Murthy Cherukumilli
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic