原文链接
由于连接未关闭,导致的连接池连接被拿完.
1.把log4j.properties设置成debug
log4j.rootLogger=debug, file, console, safe
2.c3p0-config.xml设置
<!-- 最大空闲时间,若为0则永不丢弃。Default: 0 -->
<property name="maxIdleTime">60</property>
<!-- 自动超时回收,根据最大空闲时间设置,超过maxIdleTime则缓冲池自动清除链接 -->
<property name="unreturnedConnectionTimeout">80</property>
<!-- 跟踪泄露 -->
<property name="debugUnreturnedConnectionStackTraces">true</property>
3.通过Overdue resource check-out stack trace确定异常位置