-->
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: Simulate testConnectionOnCheckout effect by java code
PostPosted: Fri Nov 11, 2011 4:56 am 
Newbie

Joined: Fri Nov 11, 2011 4:18 am
Posts: 1
Location: Italy
Good morning to everyone,
I'm a new user and my English isn't the best around :-)

I'm using a web application and, sometimes, I have MySql connection problems.
Using the testConnectionOnCheckout and preferredTestQuery options in the hibernate configuration file I resolved the problem and my application is ok now.

But, for better performances, I'd like to obtain the same effects of this option only when a particular event occurs in my application. So, for example, I'd like to obtain:

try{
...........
}
catch(Exception e){
java code to obtain the same effect of testConnectionOnCheckout option with "Select 1" query
}

Which java code I have to use?
Best wishes,
Emilio


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.