Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

State of passivated SF session bean

 
Saeed Amer
Ranch Hand
Posts: 140
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 387
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic