This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes EJB and other Java EE Technologies and the fly likes ejbStore() and ejbLoad() in Entity Beans Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "ejbStore() and ejbLoad() in Entity Beans" Watch "ejbStore() and ejbLoad() in Entity Beans" New topic
Author

ejbStore() and ejbLoad() in Entity Beans

vikasids sharma
Ranch Hand

Joined: Aug 01, 2003
Posts: 157
As EJB specification says activate and passivate methods are warning methods for EJB beans(for both session and entity beans)before actually persisting state.Incase of Entity beans we persist the data of entity bean by ejbStore() to relational database or object database etc before calling passivate() method on it.
MY question is
What do we mean by passivation of bean instance(Entity) by container when a step back ,ejbStore() saves or persisits the instance data already?
Similarly when same instance has to be put in service, ejbLoad() is called before activate().What does we mean by activate(), when persisted data is alraedy loaded by ejbLoad()?
thanks
Vikas


Thanks
Vikas Sharma
SCJP(1.4)
Harjot Narula
Greenhorn

Joined: Sep 22, 2003
Posts: 11
Hi
Activation and passivation has nothing to do with the relational or object oriented database that you are using.
These methods are called by the container in order to passivate the object when the pooled objects are finished. It passivates the object which is the oldest one used. The objects are activated when any request on that object is made and that object is not in the pooled resources.
Activate and passivate are used only in Entity beans and in Stateful session beans. Stateless session beans do not have the concept of pooled objects/resources.
Hope this answers your query.

Regards
Harjot
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: ejbStore() and ejbLoad() in Entity Beans
 
Similar Threads
EJB Persistence problem [data modifed outside EJB container]
Contradiction in Head First EJB ?
A basic Question on ejbLoad and ejbStore
Doubt on the level of lock and concurency
Bean managed Transaction for Entity Beans