-->
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: Can't reconnect database connection
PostPosted: Tue Jan 31, 2006 4:08 pm 
Newbie

Joined: Thu Jun 09, 2005 4:13 pm
Posts: 7
Hello Folks,

I am having a problem with my apps reconnecting to the database after it has timed out. For now I have just increased the mysql time out variable to some ridiculous number just to get me by. Below is what I have specified for hibernate and c3p0 connection pool but does not work.

<property name="connection.username"></property>
<property name="connection.url">jdbc:mysql://path:3306/database?autoReconnect=true</property>
<property name="dialect">net.sf.hibernate.dialect.MySQLDialect</property>
<property name="connection.password"></property>
<property name="connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="connection.autoReconnect">true</property>
<property name="connection.autoReconnectForPools">true</property>
<property name="connection.is-connection-validation-required">true</property>

<property name="c3p0.max_size">10</property>
<property name="c3p0.min_size">2</property>
<property name="c3p0.timeout">0</property>
<property name="c3p0.max_statements">50</property>
<property name="c3p0.idle_test_period">300</property>
<property name="c3p0.acquire_increment">2</property>
<property name="connection.autoReconnect">true</property>
<property name="connection.autoReconnectForPools">true</property>
<property name="connection.is-connection-validation-required">true</property>
<property name="c3p0.validate">false</property>


Hibernate version: 2.1.8

Name and version of the database you are using: MYSQL 4.1


I have tried looking up various solutions on the internet and the only thing I have found is if you try using JNDI but then you have to make changes to tomcat, hibernate and all this other stuff. Isn't there an easier solution to just have your app reconnect to the database?

Thanks,


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.