Win a copy of Escape Velocity: Better Metrics for Agile Teams this week in the Agile and Other Processes 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
  • Liutauras Vilda
  • Tim Cooke
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Frank Carver
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • fred rosenberger

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
 
I will open the floodgates of his own worst nightmare! All in a tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic