• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Conversational state and Passivation and Open Resources

 
Deepak Jain
Ranch Hand
Posts: 637
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
EJB 3.0 Core Specification: During passivation, if the stateful session bean's conversational state has references to open resources like open sockets and open database sockets then its the responsibilty of bean provider to restore such references because they will be lost during passivation. But they are exceptions to references to EntityManager and EntityManager factory. This is because the container will restore these references on behalf of bean provider because they are part of java persitence API framework which is one of the services provided by the container to session beans.

Is this understanding correct.

Based on this understanding can i say that if I have a java.sql.Connection reference to a database [Resource], I will have to explicitly close the connection before passivation and open a new connection to the data source after activation.Container allows be to do so in the PostActivate and PrePassivate lifecycle callbacks. So was this the very reason the container
decided to notify the session bean of these events, so that session bean can restore the part of the converstaion state that is not saved by the container during passivation.
****************************************
---------------
Environment
---------------
EJB Version : 3.0
Application Server: JBOSS 4.2.3.GA
J2SE: 1.5 or 5.0
OS: Windows XP
****************************************
 
Deepak Jain
Ranch Hand
Posts: 637
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Experts, Please take time and reply.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic