环境:linux+1.7 druid:1.0.22 生产数据量:41万更新,单条更新
异常现象: Caused by: java.sql.SQLException: connection holder is null at com.alibaba.druid.pool.DruidPooledConnection.checkStateInternal(DruidPooledConnection.java:1122) at com.alibaba.druid.pool.DruidPooledConnection.checkState(DruidPooledConnection.java:1113) at com.alibaba.druid.pool.DruidPooledConnection.prepareStatement(DruidPooledConnection.java:318) at se.spagettikod.optimist.impl.MySqlMapper.getCurrentEntityVersionInDatabase(MySqlMapper.java:41) at se.spagettikod.optimist.impl.OptimisticLockingInterceptor.updateImpl(OptimisticLockingInterceptor.java:70) at se.spagettikod.optimist.impl.OptimisticLockingInterceptor.intercept(OptimisticLockingInterceptor.java:150) at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:57) at com.sun.proxy.$Proxy145.update(Unknown Source) at sun.reflect.GeneratedMethodAccessor874.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:59) at com.sun.proxy.$Proxy145.update(Unknown Source) at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:145) at sun.reflect.GeneratedMethodAccessor907.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:355) ... 130 more
org.springframework.jdbc.UncategorizedSQLException:
Error updating database. Cause: java.sql.SQLException: connection holder is null Cause: java.sql.SQLException: connection holder is null ; uncategorized SQLException for SQL []; SQL state [null]; error code [0]; connection holder is null; nested exception is java.sql.SQLException: connection holder is null at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:83) at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80) at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80) at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:71) at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:365) at com.sun.proxy.$Proxy19.update(Unknown Source) at org.mybatis.spring.SqlSessionTemplate.update(SqlSessionTemplate.java:251)
配置信息: pool.initialSize=20 pool.maxActive=200 pool.maxIdle=20 pool.maxWait=10000 pool.removeAbandoned=true pool.removeAbandonedTimeout=900 pool.logAbandoned=true pool.testWhileIdle=true pool.timeBetweenEvictionRunsMillis=3000 pool.validationQuery=select 1 from dual pool.poolPreparedStatements=false pool.defaultAutoCommit=true 后来换成dbcp更新成功,没有报holder is null问题,更新数据成功
原提问者GitHub用户pandboy
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。