Open zhangkangxier opened 5 years ago
druid版本是1.1.16
druid 1.1.16 遇到同样问题
在本地重现了异常,当返回后,在DruidPooledConnection类中执行closePoolableStatement函数时,如果在最后的分之停留一会,会报出Statement is closed的SQLException,这个异常会导致Druid的Holder为null,在执行finally时,就出现了Null异常,将前面的异常覆盖了
你好,这个有解决吗?
Cause: java.lang.NullPointerException
Caused by: java.lang.NullPointerException at com.alibaba.druid.pool.DruidPooledConnection.closePoolableStatement(DruidPooledConnection.java:194) at com.alibaba.druid.pool.DruidPooledPreparedStatement.close(DruidPooledPreparedStatement.java:201) at org.apache.ibatis.executor.BaseExecutor.closeStatement(BaseExecutor.java:286) at org.apache.ibatis.executor.SimpleExecutor.doQuery(SimpleExecutor.java:65) at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:326) at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:156) at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:109) at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:83) at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:148) 打出来的栈信息显示类DruidPooledConnection在执行closePoolableStatement时出错,查看源码应该是holder为null 该holder看了下只有在处理异常时调用Connection的disable才会被置null,目前不清楚为什么会出现这个空指针,业务的日志还有以下线索: 05::38:04提交的查询请求 06:20:30才爆出这个错误,这期间程序一直在等待查询结果未做其他逻辑,查询的是presto,该问题是偶现,正常情况下一秒钟内就返回结果了。 想咨询下wenshao,该种现象是否为druid的链接状态管理出现异常,然后druid自己删除了链接,还是有其他可能的逻辑,麻烦给点思路。