-->
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: MySQL database time out - c0p3 connection pool
PostPosted: Fri Aug 28, 2009 10:46 am 
Newbie

Joined: Tue Sep 16, 2008 11:10 am
Posts: 7
Hello everybody,

I'm trying to solve the reconnection problem with MySQL server when the wait_timeout for the database connections expires.

I'm using c3p0 to manage the pool of db connections, and I have configure Hibernate as follows (excerpt of the hibernate_cfg.xml file)

Code:
<property name="hibernate.c3p0.acquire_increment">1</property>
        <property name="hibernate.c3p0.idle_test_period">1</property>
        <property name="hibernate.c3p0.max_size">100</property>
        <property name="hibernate.c3p0.max_statements">0</property>
        <property name="hibernate.c3p0.min_size">10</property>
        <property name="hibernate.c3p0.timeout">1000</property>
       
        <property name="hibernate.connection.provider_class">org.hibernate.connection.C3P0ConnectionProvider</property>


Plus I have created the c3p0.properties file and placed in the root package (which is directly included in the classpath). The properties file contains:
Code:
# c3p0.properties
c3p0.testConnectionOnCheckout=true
c3p0.testConnectionOnCheckin=true
c3p0.automaticTestTable=true
c3p0.trace=true
c3p0.debug=true

Apparently, it seems everything it should be done to address the event of broken db connection, but I still get a connection time out error when connecting to the db after the time out.

I must also mention that, after trying once - and getting the related error - the successful trial in the connection to the database goes through without any error.

Anybody could suggest where I should look into exactly? Or any ideas about this problem?

Many thanks,

Dan


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.