This week's book giveaway is in the Raspberry Pi forum.
We're giving away four copies of Getting started with Java on the Raspberry Pi and have Frank DelPorte on-line!
See this thread for details.
Win a copy of Getting started with Java on the Raspberry Pi this week in the Raspberry Pi forum!
  • 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
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Jeanne Boyarsky
Sheriffs:
  • Rob Spoor
  • Devaka Cooray
  • Liutauras Vilda
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Piet Souris

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.
 
Weeds: because mother nature refuses to be your personal bitch. But this tiny ad is willing:
Low Tech Laboratory
https://www.kickstarter.com/projects/paulwheaton/low-tech-0
reply
    Bookmark Topic Watch Topic
  • New Topic