Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ejbCreate in session bean

 
Reghu Ram Thanumalayan
Ranch Hand
Posts: 193
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Kathy,
In the chapter 4 �Being a Session Bean� under the heading �the bean things you can do from stateless bean methods � (Page 228 ) in Head First EJB, its given that we can get a reference to Home & EJB Objects in the ejbCreate & ejbRemove methods.
But for a stateless Bean, the bean is not linked with the EJB Object until the client calls a business method on the EJB Object. So how is it possible to get a reference to the EJB Object or the Home interface in the ejbCreate method which is called at a completely different/unrelated time from the time the client calls create on the home object ?
Similarly for the stateful session beans, when is the bean instance linked with the EJB Object. Is it after the setSessionContext but before the ejbCreate because then only it is possible to get reference to the EJB Object in ejbCreate which is not possible in setSessionContext !
I am not sure if this doubt sounds silly but please make me clear.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic