• 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
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Confused about SessionContext

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
On page 190 in HFE it says (about the SessionContext), among other things, that you can "get a reference to your EJB object" but on page 196 it only says you can "get a reference to your home". Is the key here where you are in the creationprocess?! I mean that on page 190 the bean has been created but on page 196 the bean itself has not been created when the setSessionContext() method is run?!
 
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you look at the lifecycle, when setSessionContext() is called by container on newly created bean, although an EJBObject is created by container, it is not associated with that particular bean instance.
when container finishes call to ejbCreate(), at that time, SessionContext and EJBObject both are linked to that particular bean.
Therefore,
inside ejbCreate(), calling sessionContext.getEJBObject() is OKAY
inside setSessionContext(), calling sessionContext.getEJBObject() is NOT OKAY
reply
    Bookmark Topic Watch Topic
  • New Topic