spring c3p0 mysql报错
An SQLException was provoked by the following failure: com.mchange.v2.resourcepool.ResourcePoolException: Attempted to use a closed or broken resource pool
Cause: com.mchange.v2.resourcepool.ResourcePoolException: Attempted to use a closed or broken resource pool
不知道为什么,服务器运行一段时间后,就会出现上面的异常,通常为1个星期左右,时间短一点几天就出异常了!刚启动的时候是不会出现异常的。
连接吃配置:
<Resource name="jdbc/wwwPool" auth="Container"
description="DB Connection"
type="com.mchange.v2.c3p0.ComboPooledDataSource"
factory="org.apache.naming.factory.BeanFactory"
driverClass="com.mysql.jdbc.Driver"
jdbcUrl="xxx" user="xxx"
password="xxx" initialPoolSize="3" minPoolSize="3" maxPoolSize="3"
maxIdleTime="1800" acquireIncrement="2" maxStatements="0"
idleConnectionTestPeriod="1800" acquireRetryAttempts="30"
breakAfterAcquireFailure="true" testConnectionOnCheckout="false" />