我在“测试和生产环境”中遇到此问题。当数据库连接断开一段时间后,数据库启动后,应用程序日志显示它运行正常,但实际上批处理作业不再运行,我必须重新启动服务器。
因此,要解决该问题,我必须在本地重现该问题。 有人可以告诉我如何在本地重现此异常。
java.sql.SQLRecoverableException: Closed Connection
at oracle.jdbc.driver.PhysicalConnection.needLine(PhysicalConnection.java:4216) ~[ojdbc6-12.1.0.2.jar:12.1.0.2.0]
at oracle.jdbc.driver.OracleStatement.closeOrCache(OracleStatement.java:1431) ~[ojdbc6-12.1.0.2.jar:12.1.0.2.0]
at oracle.jdbc.driver.OracleStatement.close(OracleStatement.java:1410) ~[ojdbc6-12.1.0.2.jar:12.1.0.2.0]
at oracle.jdbc.driver.OracleStatementWrapper.close(OracleStatementWrapper.java:102) ~[ojdbc6-12.1.0.2.jar:12.1.0.2.0]
at com.mchange.v2.c3p0.impl.NewProxyStatement.close(NewProxyStatement.java:178) ~[c3p0-0.9.5.2.jar:0.9.5.2]
at com.mchange.v1.db.sql.StatementUtils.attemptClose(StatementUtils.java:53) [mchange-commons-java-0.2.11.jar:0.2.11]
at com.mchange.v2.c3p0.impl.DefaultConnectionTester.activeCheckConnection(DefaultConnectionTester.java:325) [c3p0-0.9.5.2.jar:0.9.5.2]
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.testPooledConnection(C3P0PooledConnectionPool.java:510) [c3p0-0.9.5.2.jar:0.9.5.2]
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.testPooledConnection(C3P0PooledConnectionPool.java:464) [c3p0-0.9.5.2.jar:0.9.5.2]
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.refurbishIdleResource(C3P0PooledConnectionPool.java:436) [c3p0-0.9.5.2.jar:0.9.5.2]
at com.mchange.v2.resourcepool.BasicResourcePool$AsyncTestIdleResourceTask.run(BasicResourcePool.java:2211) [c3p0-0.9.5.2.jar:0.9.5.2]
我正在使用spring-batch
,oracle 12c
。
c3P0 datasource
用于与数据库建立连接。