• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Question on stateless bean and it's ejbCreate()

 
Vijay Gade
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I just read that the stateless session bean and the EJB object will only be tied when the client calls a business method on the EJB object, NOT when the ejbCreate method is called. Which also means, I am assuming, the session context is tied to the bean, but, the session context has no idea about the EJB object.
Then on the next page, I read that within the ejbCreate method, one can use the session context to access reference to the home and the ejb object.
What I did not understand is that, when the ejbCreate method has no link with the EJB object, how can one access the EJB object's reference from within the ejbCreate method? It's only after the business method is called, the container pulls a bean out of the pool and links it with the client's ejb object.
 
Ugender Rekulampally
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Vijay,
The way stateless session beans create in the pool is kinda confusing and complex way.
Server supplies an EJBObject(dummy/fake) implicitly to create an instance since the bean won't be assigned a real EJBObject from a client till the client calls a business method.
Kathy Sierra explaied about it here in this forum sometime back ..I tried to find that discussion link but couldnt...if you look for the discusson with many replies probably you can find

But I am sure the question/topic you raised is very intriguing...

Thanks,
Ugender
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic