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 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


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "State of passivated SF session bean" Watch "State of passivated SF session bean" New topic
Author

State of passivated SF session bean

Saeed Amer
Ranch Hand

Joined: Jan 20, 2004
Posts: 139
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?

TIA,
Saeed
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.


Ganesh
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.

Herman
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: State of passivated SF session bean
 
Similar Threads
Who close the connections
session bean and transaction
Beta Mock Question - Session Bean Passivation
statefull session bean passivation
https and session state