This week's book giveaway is in the HTML Pages with CSS and JavaScript forum.
We're giving away four copies of Testing JavaScript Applications and have Lucas da Costa on-line!
See this thread for details.
Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Conversational state and Passivation and Open Resources

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