This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Murach's Python Programming and have Michael Urban and Joel Murach on-line!
See this thread for details.



Only 44 hours left in the trailboss' kickstarter!

New rewards and stretch goals. CLICK HERE!



Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Activate passivate in entity beans  RSS feed

 
Hari babu
Ranch Hand
Posts: 208
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
Does the conatiner activate and passivate an entity bean. I think whenever container wants service other requests, it calls the ejbStore to store the data to DB and assigns a new ejbObject to that bean. Am i missing soemthing here ?
Thanks in advance
Hari
 
JeanLouis Marechaux
Ranch Hand
Posts: 906
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's up to the container to passivate an EJB when it wants to optimize its working set.
It concerns Stateful EJB and entity Beans which are idle AND not in a transaction.
the ejbStore is called before the ejbPassivate as ejbPassivate is really the last method before the state of the bean becomes passive
 
Byron Estes
Ranch Hand
Posts: 313
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hari Babu,
If you have Orielly's Enterprise JavaBeans 2nd Edition by Richard Monson-Haefel, take a look at
pg 55-57 on "The Activation Mechanism".
The last paragraph in that section reads as follows...
"Enity beans do not have conversational state that needs to be serialized like stateful beans; instead the state of the entity bean instances is persisted directly to the database. Entity beans do, however, leverage the activation callback methods (ejbActivate() and ejbPassivate()) to notify the instance when it's about to be swapped in or out of the instance pool."
Those callback methods are an opportunity to obtain and release any resources or perform any other work prior to the loading or after the storing of persistent data.
Regards,
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!