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

activation/passivation methods ejbLoad()/ejbStore() methods  RSS feed

 
Leena Diwan
Ranch Hand
Posts: 351
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello !
Once I was asked if the container takes care for the activation and passivation. And also does the store and load from db(for CMP) then why should we give an EMPTY body for the methods ??
I think it is for doing some pre or post jobs. Is it like this ? and if yes, what kind of jobs will be done in these methods ?
Can anyone help ?
Leena
 
Kyle Brown
author
Ranch Hand
Posts: 3892
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are right, they are for pre and post operations.
For instance, if you have a transient (non-serializable) variable in your EJB you can "clear it out" in the passivate() method prior to serialization of the bean to a file (which the container will do) and "set it back up" in the activate() method after the bean has been de-serialized.
Likewise in EJB 1.1 you can use the ejbLoad() and ejbStore() method to manage BMP fields in a BMP subclass of a CMP bean (stange but true -- read the spec...)
Kyle
------------------
Kyle Brown,
Author of Enterprise Java (tm) Programming with IBM Websphere
See my homepage at http://members.aol.com/kgb1001001 for other WebSphere information.
 
Leena Diwan
Ranch Hand
Posts: 351
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Kyle !
It made me confident about what I thought.
Do u know from where can I get the specs ?
sun site ? do u have the url for it ?
Thanks again !
Regards..
Leena
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!