`

mysql的wait_timeout 的原因,有可能c3p0的连接失败,造成请求失败

阅读更多
mysql的wait_timeout 的原因,有可能c3p0的连接失败,造成请求失败

解决方法:

在jdbc.properties加入
c3p0.testConnectionOnCheckin=true
c3p0.testConnectionOnCheckout=true

在Spring-Dbconfig.xml的所有datasource中添加,
<property name="testConnectionOnCheckin">
<value>${c3p0.testConnectionOnCheckin}</value>
</property>
<property name="testConnectionOnCheckout">
<value>${c3p0.testConnectionOnCheckout}</value>
</property>
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics