-->
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.  [ 9 posts ] 
Author Message
 Post subject: recommended dbpool for a production mysql database
PostPosted: Sat Jan 17, 2004 12:58 pm 
Beginner
Beginner

Joined: Sun Dec 14, 2003 10:47 am
Posts: 23
Hi,
I am moving a hibernate app into production. It will use a mysql 4.0 server with the standard jdbc driver. Standard webapp usage (up 7/24).Could someone recommend a dbpool? I would like it to be able to reconnect automatically to the database if the db goes down (as we take the db down for 5 minuts each nite to do a backup).


I have heard issues with some of the standard ones in the past when used with mysql (where mysql drops the connetrion after a period of time 4 hours). I think the issue was with c3po but not 100% sure.

thanks,
Fizzy


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jan 17, 2004 1:04 pm 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
You can let the pool validate by setting hibernate.dbcp.testOnBorrow=true or hibernate.c3p0.validate=true


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jan 17, 2004 3:00 pm 
Senior
Senior

Joined: Wed Aug 27, 2003 6:04 am
Posts: 161
Location: Linz, Austria
The MySQL problem is easy to solve: simply add "?autoReconnect=true" to your MySQL JDBC URL, and the driver will automatically reconnect when a Connection has been dropped.

Juergen


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jan 17, 2004 4:44 pm 
Regular
Regular

Joined: Fri Sep 05, 2003 12:01 am
Posts: 80
Location: Bogot
I use hibernate with a JBoss controlled datasource and mysql. I highly recommend it. the app runs 24/7 and never has had any problems. Before that were using the dbcp pool with autoreconnect=true but it failed at some point or another (even with the DB in the same machine!).

_________________
Mauricio Hern


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jan 17, 2004 4:47 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
yeah, if you are running in an appserver, you should always use your appserver connection pool, since it is usually MUCH more robust than DBCP, for example.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jan 17, 2004 8:04 pm 
Beginner
Beginner

Joined: Sun Dec 14, 2003 10:47 am
Posts: 23
I am using Resin Basic (i.e. the servlet containter but not the app server). I will have to look to see if it supports this. If anyone knows please chime in :-)


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jan 17, 2004 8:41 pm 
Beginner
Beginner

Joined: Sun Dec 14, 2003 10:47 am
Posts: 23
Hmmm... Resin supports JNDI data sources. Is this an "app server connection pool"?


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jan 18, 2004 5:50 am 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
fizzy wrote:
Hmmm... Resin supports JNDI data sources. Is this an "app server connection pool"?


Most likely, yes.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 03, 2004 1:34 pm 
Beginner
Beginner

Joined: Sun Dec 14, 2003 10:47 am
Posts: 23
I have been running with Resin's JNDI data source for 2 weeks now with no issues (compared to 1 or 2 a day)....

Resin has a ping feature that I am using that let's you ping the database in any or all of the following ways... on free, on idle and on use...

We are using the "on use" method (i.e. it pings the db connection just before it gives the resource out) since that allows us to arbitrarily take the database up and down without needing to restart the webapp...


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