-->
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.  [ 4 posts ] 
Author Message
 Post subject: MySQL Connection timeout
PostPosted: Mon Jul 26, 2004 11:40 am 
Newbie

Joined: Mon Jul 26, 2004 11:35 am
Posts: 13
Hi,
I hope you can help me. I have battling connection timeout issue with Mysql for a month now. I am using hibernate 2 with c3p0 connection pool. Hibernate config file below:

<session-factory>
<!-- properties -->
<property name="session_factory_name">jdbcSessionFactory</property>
<property name="jdbc.use_scrollable_resultset">true</property>
<property name="cglib.use_reflection_optimizer">false</property>
<property name="show_sql">false</property>
<property name="use_outer_join">true</property>
<property name="query.substitutions">true=1, false=0</property>

<!-- connection parameters -->
<property name="connection.provider_class">net.sf.hibernate.connection.C3P0ConnectionProvider</property>
<property name="connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="connection.url">jdbc:mysql://localhost:3306/mydb?autoReconnect=true</property>
<property name="connection.username">username</property>
<property name="connection.password">password</property>
<property name="connection.autoReconnect">true</property>
<property name="connection.autoReconnectForPools">true</property>
<property name="connection.failOverReadOnly">true</property>
<property name="connection.is-connection-validation-required">true</property>

<!-- connection pool settings -->
<property name="c3p0.minPoolSize">5</property>
<property name="c3p0.maxPoolSize">60</property>
<property name="c3p0.timeout">600</property>
<property name="c3p0.max_statement">300</property>
<property name="dialect">net.sf.hibernate.dialect.MySQLDialect</property>

<!-- mapping files -->
<mapping resource="com/planet/struts/beans/or-mapping.hbm.xml"/>
<mapping resource="com/planet/struts/beans/admin/or-mapping.hbm.xml"/>
</session-factory>

After certain period of time connection timesout, then once refreshed it works fine. Any suggestions are appreciated.
Thank you.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 26, 2004 11:44 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
search the forum, this has been discussed many times


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 26, 2004 12:19 pm 
Newbie

Joined: Mon Jul 26, 2004 11:35 am
Posts: 13
gavin,
I searched through topics, and bit uncertain.
C3P0 does not test idle connections, unless specified using
<property name="c3p0.idle_test_period">100</property> property?
Would that solve?
Thanks.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 27, 2004 10:14 pm 
Regular
Regular

Joined: Tue Sep 30, 2003 11:27 am
Posts: 60
Location: Columbus, OH, USA
This should help:
http://forum.hibernate.org/viewtopic.php?t=932350&highlight=
Scott


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