简体   繁体   中英

Connection is invalid in connection pooling

I am using c3p0 for connection poolingin my java application. We write the all properties related to it and i am having wait_timeout value is 60. We can not increase wait_timeout value. I got error "connection is invalid". How to handle this error.

you should set max_idle_time for waiting timeout ; for example :

<property name="hibernate.c3p0.min_size">5</property>
<property name="hibernate.c3p0.max_size">50</property>
<property name="hibernate.c3p0.timeout">15</property>
<property name="hibernate.c3p0.max_idle_time">60</property>
<property name="hibernate.c3p0.max_statements">50</property>
<property name="hibernate.c3p0.idle_test_period">10</property> 

see this link : http://www.mchange.com/projects/c3p0/index.html#configuration_files

you can find same question in stack overflow fro example :

Hibernate c3p0 connection pool not timing out idle connections

c3p0 maxIdleTime is same as wait_timeout of mysql?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM