-->
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.  [ 1 post ] 
Author Message
 Post subject: How do I handle session.getConnection().isClosed() ?
PostPosted: Sat May 12, 2007 8:37 pm 
Newbie

Joined: Sat Apr 21, 2007 9:48 pm
Posts: 9
If suppose in my application; db connection got closed ( due to any reasons like DB got restarted OR mysql timeout of 8 hrs over so mysql closes the connection) . Now if I do sess.isOpen() or sess.isConnected() both returns true but

sess.connection().isClosed() returns true...

I am using current_session_context_class as thread. So, how do I handle this ? I mean before returning getCurrentSession() I can always check above condition but if its true how do I remove this connection from sessionFactory pool so that sessionfactory pool does not return this session ever ?

I tried session.reconnect() but that doesnt work though its deprecated.


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

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.