-->
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: Resetting Connections when Lost?
PostPosted: Fri Nov 20, 2009 2:48 pm 
Newbie

Joined: Fri Nov 20, 2009 2:39 pm
Posts: 4
Hi, I'm hoping someone can help me here!

We are using Hibernate with SQL Server, and one of our clients is experiencing situations where every once in a while the connection cannot be opened (we get a SQLException for "Exception:Cannot open connection"). It looks like this is an issue with their network, and they can't seem to resolve it. We are deploying within JBoss and using a pool of connections.

Is there a way to configure or code within Hibernate to be able to, in the event that it fails trying to get a connection, that it tries to get another one? Or kill the bad connection and then retry? Or verify the connection prior to doing the query? We can try to do a lot of workaround coding, but I was wondering if this was something that we could build using Hibernate itself.

Thanks in advance!


Top
 Profile  
 
 Post subject: Re: Resetting Connections when Lost?
PostPosted: Sun Nov 22, 2009 1:37 pm 
Newbie

Joined: Mon Nov 28, 2005 2:35 pm
Posts: 14
Hi!

There is a tag <check-valid-connection-sql> you can use in datasource files.

See

http://www.jboss.org/community/wiki/ConfigDataSources

kind regards

foster


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.