• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Conversational state and Passivation and Open Resources

 
Ranch Hand
Posts: 637
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Experts, Please take time and reply.
 
reply
    Bookmark Topic Watch Topic
  • New Topic