GeeCON Prague 2014*
The moose likes Architect Certification (SCEA/OCMJEA) and the fly likes if variables not set to null before passivation? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Certification » Architect Certification (SCEA/OCMJEA)
Bookmark "if variables not set to null before passivation?" Watch "if variables not set to null before passivation?" New topic
Author

if variables not set to null before passivation?

yamini nadella
Ranch Hand

Joined: Apr 13, 2004
Posts: 257
in stateful session beans non-transient and non-serializable fields have to be set to null before passivation.

if this statement is true then what happens if we wont set them to null?
Santosh Pasupuleti
Ranch Hand

Joined: Aug 10, 2005
Posts: 97
___________________________________________________________________________
in stateful session beans non-transient and non-serializable fields have to be set to null before passivation.

if this statement is true then what happens if we wont set them to null?
___________________________________________________________________________

The conversational state of stateful session bean is defined as the session bean instance's field values, plus the transitive closure of the objects from the instance's fileds reached by following Java object references.

In advanced cases, a session bean's conversational state may contain open resources, such as open sockets, and open database cursors.

A CONTAINER CAN NOT RETAIN SUCH RESOURCES WHEN A SESSION BEAN INSTANCE IS PASSIVATED.

A developer of such a session bean must close and open the resources in the ejbPassivate and ejbActivate notifications.
 
GeeCON Prague 2014
 
subject: if variables not set to null before passivation?