For Entity Beans, What happens to an instance field...
3 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   bob_miller
Posted On:   Friday, March 2, 2001 03:21 AM

For Entity Beans, What happens to an instance field not mapped to any persistent storage,when the bean is passivated ?

Re: For Entity Beans, What happens to aninstance field...

Posted By:   sanjay_datta  
Posted On:   Monday, April 9, 2001 08:00 AM

When a CMP Entity bean is passivated the container disassociates the Bean instance from the EJBobject and primarykey and releases any resources it has been holding such as sockets.

To save the instance's field to the database, ejbStore() is invoked just before passivation is invoked.

Any field not associated/mapped to the persistent database storage is not saved/stored into the Database.

Re: For Entity Beans, What happens to an instance field...

Posted By:   Jonathan_Morrissey  
Posted On:   Monday, March 19, 2001 09:46 AM

The specification infers that the container never serializes an instance of an Entity bean (unlike stateful session beans). Thus passivation simply involves moving the bean from the "ready" to the "pooled" bin. So what happens to the contents of an instance variable is controlled by the programmer. Remember that when an entity bean is passivated the instance gets logically disassociated from it's remote object.


Be careful here, as the functionality of passivation/activation for Stateless Session, Stateful Session and Entity beans is completely different. For entity beans the ejbPassivate method notifies the entity bean that it is being disassociated with a particular entity prior to reuse or for dereferencing and possible garbage collection. Unlike stateful session beans the state does not need to be stored in secondary storage as by definition it already exists in permanent storage.

Re: For Entity Beans, What happens to aninstance field...

Posted By:   Anonymous  
Posted On:   Thursday, March 15, 2001 09:05 PM

It will return to Pooled state,
ejbPassivate() remove un referenced instances
About | Sitemap | Contact