Caused by: java.sql.SQLException: connection holder is null

使用阿里巴巴的druid连接池报错:Caused by: java.sql.SQLException: connection holder is null

错误原因:因业务程序本身运行比较慢长或程序异常后没有关闭连接,导致的数据库连接超过了removeAbandonedTimeout规定的时间没有主动关闭,连接池启用自我保护机制把连接关了,当程序再使用这个连接就报错了。

解决方案:

把连接池配置中的removeAbandonedTimeout参数调整为30分钟,如下:




你可能感兴趣的:(java,mysql,oracle,数据库)