• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

ejbCreate in session bean

 
Ranch Hand
Posts: 193
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic