• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Ranch Hand
Posts: 351
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
author
Posts: 3892
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
reply
    Bookmark Topic Watch Topic
  • New Topic