File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes State of passivated SF session bean Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "State of passivated SF session bean" Watch "State of passivated SF session bean" New topic

State of passivated SF session bean

Saeed Amer
Ranch Hand

Joined: Jan 20, 2004
Posts: 140
Hi Valentin/Seema,

Suppose a SF session bean contained a JDBC connection along with other bean data. If the bean is passivated, would the JDBC connection info also be searlized? If so, would this JDBC connection info be useful when the bean is activated?

How are Remote references and/or plain old Java references handled during SFB passivation/activation?

Ganesh.P Ram
Ranch Hand

Joined: Dec 22, 2005
Posts: 41
Hi Saeed,

When the ejbPassivate() of your SFSB is called, then all the transient instances should be in one of the states that is mentioned in HFEJB (like null,Serializable object and so on..pls refer to HFEJB for the complete list.)

The jdbc Connection object is not serializable.
So in your ejbPassivate(), you will have to explicitly assign it to null (to meet the above said condition).

In your ejbActivate(), you will have to get back the connection explicitly.
All the serializable attributes will get back their previous state. You dont have to bother abt that.

Hope this answers your question.

Herman Schelti
Ranch Hand

Joined: Jul 17, 2006
Posts: 387
hi Saeed Amer,

the connection object does not get serialized.

For best performance: call close() on any connection object that you don't need anymore, don't wait for passivation to do so.

I agree. Here's the link:
subject: State of passivated SF session bean
It's not a secret anymore!