Another way to solve this is to tell Tomcat not to serialize the session data when shutting down. Granted, this may not be optimal for your particular environment, especially for a hot redeploy.

Here's how you do it:

<Context path="/example" docBase="example.war">
  <Manager className="org.apache.catalina.session.PersistentManager"
      saveOnRestart="false"/>
  <!-- other stuff here -->
</Context>

The Manager element does the trick. This has been tested with Tomcat 4.x and 5.x.


Gavin King wrote:

AFAICT, it should be the application's responsibility to ensure that it bootstraps Hibernate *before* the session is deserialized.

Then the lookup would be successful.

Christian Bauer wrote:

We have problem with "SessionFactory not found: null" messages when Tomcat reloads a servlet context. This happens when you have a disconnected Session in your HttpSession, which is then serialized/deserialized while the classloader is restarted. This breaks the internals of Hibernate, as Hibernate tries to lookup the SessionFactoryImpl for the Session in a singleton HashMap in SessionFactoryObjectFactory on deserialization.

Note that this is not a problem usually in application servers, where the lookup can be made using JNDI. Any ideas are welcome.

http://opensource.atlassian.com/projects/hibernate/browse/HB-1069





--
Nick Heudecker
System Mobile, Inc.
Email: [EMAIL PROTECTED]
Phone: 312.420.8217
Web: http://www.systemmobile.com


-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - digital self defense, top technical experts, no vendor pitches, unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
hibernate-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hibernate-devel

Reply via email to