Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

confusion on ejbCreate

 
Soni Prasad
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a confusion on ejbCreate method of stateless session bean that is when container calls ejbCreate to create a bean for pool EJBObject is not created then how can one permitted to call getEJBObject() method on SessionContext in ejbCreate() method.

soni.
 
KasiMurugan Ramasamy
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Soni,

A good question you have asked. When we are deploying a bean the home object would be created and bind to a JNDIName in the JNDI NameSpace, like when creating a pool for particular stateless sessionbean, first it creates the ejbobject and ejblocalObject, then only container creates the pool.

Its upto container dependent only one or more ejbObject and ejblocalObject for a particular stateless session bean.

Because these objects are only present in server(If container provides only one ejbobject and ejblocalobject), we may thing like servlet(multi thread model).


I hope it will help you.
 
Soni Prasad
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanx for the answer..
ok then it means every instance in a pool is having an EJBObject but when a client calls create method on stateless bean's home an EJBObject is created then will the chosen(from pool) EJB's EJBObject be replaced by the EJBObject created by the create call?
[ July 12, 2005: Message edited by: Soni Prasad ]
 
Wei-ju Wu
Ranch Hand
Posts: 147
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
in fact this is a question which also bugged me for a while, thankfully, a search in this forum was pretty helpful, here is a very detailed answer by Kathy:

Link to Kathy's answer

To Kathy and Bert: you might want to include that answer as an addition to "there are no Dumb Questions" into HFEJB. I have looked up the spec and the javadoc and they really do not explain this topic well.
 
Soni Prasad
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you so much Wei-ju Wu for providing this link.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic