-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: How to do a ungraceful shutdown cleanup?
PostPosted: Wed Jan 07, 2004 3:33 pm 
Beginner
Beginner

Joined: Tue Nov 18, 2003 12:34 am
Posts: 39
Location: Dallas, Texas, US
Hello,
I have a factory method to encapsulate the OpenSession() in HibernateSesssionFactory and it does not store any reference to the created sessions. And now I need add a shutdownhook to my application in order to complete any pending transactions and to release database locks. Is there a way to get the references of the created sessions (JDBC) from hibernate so that I can call flush/commit/rollback/clean method on each of them? I would think I would have to work with the connection pool (I am currently using Hibernate's connection pool).

The easiest way would be to store the references, but it would be difficult to "maintain" the reference table. My guess is that the connection pool should have this info anyway that I can make use of. Please suggest any ideas on how to achieve this.

Thank you very much,
Madhan.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 12, 2004 7:06 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Don't use the Hibeernate connection pool. It's not intended to be in production. Use a third party one (the one with your app server, c3p0, dbcp, ...)

There is no session pool inside Hibernate, you'll have to maintain it by yourself

_________________
Emmanuel


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.