Win a copy of Spark in Action this week in the Open Source Projects 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Confusion on EJB Life Cycle HFEJB Pg 94, 100

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HFEJB on Pg 94 has a picture that shows Step 5 where the call to create() method is shown in steps : The services kick in and the bean is created followed by EJBObject is made.

But on Pg 100, in the Architectural Overview :Creating a Stateful Session Bean, the process is shown reversed. It shows that first the EJBObject is created for the bean and then the bean is instantiated.

Which one is the correct one to be followed or there is something which I have misread/misinterpreted.
 
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I believe that the container creates the EJBObject before the bean. As you will see in the later chapters, EJBObect is always created before the bean. (For stateful session beans)

Look at page 179, 192 of HF-EJB
 
Ranch Hand
Posts: 379
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Chander Puri:
HFEJB on Pg 94 has a picture that shows Step 5 where the call to create() method is shown in steps : The services kick in and the bean is created followed by EJBObject is made.

But on Pg 100, in the Architectural Overview :Creating a Stateful Session Bean, the process is shown reversed. It shows that first the EJBObject is created for the bean and then the bean is instantiated.

Which one is the correct one to be followed or there is something which I have misread/misinterpreted.




I think the order doesn't really matters, unless until the container gives the bean the beanness. Here it matters, because depending on the different moments in the bean lifecycle, the bean class can perform some operation rather than others.

The important moment is when the Container invokes setSessionContext() and ejbCreate(), linking bean instance, EJBObject and SessionContext together.

Marco
 
Don't get me started about those stupid light bulbs.
    Bookmark Topic Watch Topic
  • New Topic