• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HFEJB p.96: How does EJB Lifecycle depend on different bean types?

 
Darya Akbari
Ranch Hand
Posts: 1855
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

please view the "Sharpen your pencil" example from the HFEJB book p.96 and look at the RED marks. Can someone explain more on how the EJB lifecycle depends on the bean type .



Regards,
Darya
 
Ramakrishnan Viswanathan
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Stateful session bean: When client calls create(...), a new EJB object and a new bean instance is created by the container.

Stateless session bean: Bean creation and EJBObject creation are not tied to each other. The bean will not be tied to the EJBObject until the client makes a business method call.

Entity Beans: Bean instance creation and entity creation are not tied to each other. ejbCreate() is called on the bean before even creating an EJB object (primary key is required). And there are differences on who creates the entity in the underlying store between BMP and CMP entity beans.

MDB: Bean pulled out from the pool by container to service a message request from messaging service. (of course no client/home+remote interfaces here!)

If you look at the sequence diagrams for creation of the different bean types in HFEJB, you will notice that the order changes.
 
Peer Reynders
Bartender
Posts: 2968
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Don't worry it'll become clearer later in the book.

However get the EJB 2.0 specification. You can search that electronic document faster for an answer than you can flip through the paper copy of HFEJB - and HFEJB references the specification in most of the mock answer questions.

Also make sure that you update your HFEJB with theconfirmed errata.
Before you report any new ones check the unconfirmed errata.
 
Anand Wadhwani
Ranch Hand
Posts: 151
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In HF-EJB book that I have, the page #96 is not displayed as it appears in Darya's image above. In my book, only 2nd point is mentioned all other are blank. Please advise if I have the latest edition/print of the book!

Thanks very much!
 
Peer Reynders
Bartender
Posts: 2968
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That page comes from the supplementary material (on PDF) "Sharpen Your Pencil exercise answers" found on the Sierra/Bates web siteWickedly Smart
 
Anand Wadhwani
Ranch Hand
Posts: 151
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Peer Boss! You rock!!

Hats off to your help. People hardly look back after getting certified. I really feel great about you responding in this forum!

THANKS A LOT!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic