-->
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.  [ 3 posts ] 
Author Message
 Post subject: Oracle 11g reconnection?
PostPosted: Tue Jun 03, 2008 7:29 pm 
Newbie

Joined: Tue Jun 03, 2008 7:24 pm
Posts: 1
I'm evaluating Hibernate as a potential JPA solution for a custom application. We would like the application to automatically reconnect cleanly in the case where our Oracle 11g database is restarted.

For the sample application I wrote, I get a "recv failed" error when the application attempts to contact the restarted database. If I use c3p0 as follows:

props.put("hibernate.c3p0.min_size", "1");
props.put("hibernate.c3p0.max_size", "10");
props.put("hibernate.c3p0.timeout", "300");
props.put("hibernate.c3p0.max_statements", "50");
props.put("hibernate.c3p0.idle_test_period", "3000");
props.put("hibernate.c3p0.validate", "true");

I instead get socket errors, but still no reconnection.

Rather than play guessing games, is there a straightforward way to get hibernate to automatically reconnect?

Thanks,
John


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 04, 2008 5:58 am 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
Hi,
it appears "idleConnectionTestPeriod" is missing, also you should select an appropriate connection testing strategy.
You'll find all details well explained in the docs included in the c3p0 package:
http://sourceforge.net/project/showfiles.php?group_id=25357
Also the docs contain some more suggestions for Oracle.

BTW this is meant for a standalone app right?
When deploying in an application server as JBoss you don't need to use c3p0 and can enable very smart behavior just setting some options in the datasource definition.

_________________
Sanne
http://in.relation.to/


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 04, 2008 5:59 am 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
also "validate" is deprecated.

_________________
Sanne
http://in.relation.to/


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.