SQL关闭的语句

今天一天简直要被下面中的bug弄爆炸了,用户也时不时反馈过来。解决了一天简直生不如死,务必做一下记录

26-Aug-2019 19:02:44.839 SEVERE [http-apr-8080-exec-10] org.apache.catalina.core.StandardWrapperValve.invoke Servlet.service() for servlet [dispatcher] in context with path [/zzb] threw exception [Request processing failed; nested exception is com.gentlesoft.persistence.mybatis.SQLExecuteException: org.springframework.dao.RecoverableDataAccessException: 
### Error updating database.  Cause: java.sql.SQLRecoverableException: 关闭的语句
### SQL: update LAOGANHUOBASEMESSAGE      SET ZUZHIID = ?,          TYPEID = ?,          ZUZHINAME = ?,          TYPENAME = ?,          NAME = ?,          SEX = ?,          MINZU = ?,          JIGUAN = ?,          XLXW = ?,          ZZMM = ?,          SFZH = ?,          ADDRESS = ?,          TEL = ?,          JBGZ = ?,          QTJT = ?,          BIRTH = ?,          AGE = ?,          LEIBIE = ?,          WORKTIME = ?,          JOINTIME = ?,          OUTTIME = ?,          WORKLENGTH = ?,          OLDCOMPANY = ?,          OLDCOMPANYTYPE = ?,          NOWCOMPANY = ?,          NOWPAYTIME = ?,          DWZW = ?,          ZHIJI = ?,          DEATHTIME = ?,          WORKMESSAGE = ?,          FAMILYMESSAGE = ?,          OTHERMESSAGE = ?,          EXT1 = ?,          EXT2 = ?,          EXT3 = ?,          EXT4 = ?,          EXT5 = ?,          EXT6 = ?,          EXT7 = ?,          EXT8 = ?,          EXT9 = ?,          EXT10 = ?,          EXT11 = ?,          EXT12 = ?,          EXT13 = ?,          EXT14 = ?,          EXT15 = ?,          EXT16 = ?       WHERE ID = ?
### Cause: java.sql.SQLRecoverableException: 关闭的语句
; SQL []; 关闭的语句; nested exception is java.sql.SQLRecoverableException: 关闭的语句] with root cause
 java.sql.SQLRecoverableException: 关闭的语句
	at oracle.jdbc.driver.OracleClosedStatement.exitImplicitCacheToActive(OracleClosedStatement.java:7880)
	at oracle.jdbc.driver.OraclePreparedStatementWrapper.exitImplicitCacheToActive(OraclePreparedStatementWrapper.java:6777)
	at com.alibaba.druid.util.OracleUtils.exitImplicitCacheToActive(OracleUtils.java:79)
	at com.alibaba.druid.pool.PreparedStatementPool.get(PreparedStatementPool.java:66)
	at com.alibaba.druid.pool.DruidPooledConnection.prepareStatement(DruidPooledConnection.java:326)
	at org.apache.ibatis.executor.statement.PreparedStatementHandler.instantiateStatement(PreparedStatementHandler.java:87)
	at org.apache.ibatis.executor.statement.BaseStatementHandler.prepare(BaseStatementHandler.java:88)
	at org.apache.ibatis.executor.statement.RoutingStatementHandler.prepare(RoutingStatementHandler.java:59)
	at sun.reflect.GeneratedMethodAccessor119.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.apache.ibatis.plugin.Invocation.proceed(Invocation.java:49)
	at com.gentlesoft.persistence.mybatis.paging.PaginaTionInerceptor.prepare(PaginaTionInerceptor.java:133)
	at com.gentlesoft.persistence.mybatis.paging.PaginaTionInerceptor.intercept(PaginaTionInerceptor.java:56)
	at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:61)
	at com.sun.proxy.$Proxy148.prepare(Unknown Source)
	at org.apache.ibatis.executor.SimpleExecutor.prepareStatement(SimpleExecutor.java:85)
	at org.apache.ibatis.executor.SimpleExecutor.doUpdate(SimpleExecutor.java:49)
	at org.apache.ibatis.executor.BaseExecutor.update(BaseExecutor.java:117)
	at org.apache.ibatis.executor.CachingExecutor.update(CachingExecutor.java:76)
	at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:198)
	at sun.reflect.GeneratedMethodAccessor184.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:434)
     …………………………(略)

一开始考虑连接池参数配置问题,找到项目里的applicationContext.xml文件,如下:

重点检查里面框红线部分,可将poolPreparedStatements的值换成true(或false)尝试,但是未果。

又检查Oracle版本及驱动、ojdbc的jar包和druied连接池的jar包,最后决定将druied的jar包升级成最新版本,再次重新启动项目测试,OK!

 


版权声明:本文为suyu_happy原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。