0 0

c3p0的问题,java.sql.SQLException: Some resources failed to close properly5

报错的完整信息:
java.sql.SQLException: Some resources failed to close properly while closing com.mchange.v2.c3p0.impl.NewPooledConnection@71a2f5b1
at com.mchange.v2.c3p0.impl.NewPooledConnection.close(NewPooledConnection.java:571)
at com.mchange.v2.c3p0.impl.NewPooledConnection.close(NewPooledConnection.java:234)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.destroyResource(C3P0PooledConnectionPool.j
ava:470)
at com.mchange.v2.resourcepool.BasicResourcePool$1DestroyResourceTask.run(BasicResourcePool.java:964)
at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:547)
2012-05-14 19:45:48.850 WARN - com.mchange.v2.resourcepool.BasicResourcePool$1DestroyResourceTask.run(BasicResourcePool.java:972)Failed to d
estroy resource: com.mchange.v2.c3p0.impl.NewPooledConnection@646d6aa0
java.sql.SQLException: Some resources failed to close properly while closing com.mchange.v2.c3p0.impl.NewPooledConnection@646d6aa0
at com.mchange.v2.c3p0.impl.NewPooledConnection.close(NewPooledConnection.java:571)
at com.mchange.v2.c3p0.impl.NewPooledConnection.close(NewPooledConnection.java:234)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.destroyResource(C3P0PooledConnectionPool.j
ava:470)
at com.mchange.v2.resourcepool.BasicResourcePool$1DestroyResourceTask.run(BasicResourcePool.java:964)
at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:547)






什么情况下回出现这种问题呢?
数据库用的是oracle,
程序化中用了两个数据库连接池,属性都一样。
数据源配置配置了如下属性:
#连接池最大连接数
oracle.maxPoolSize=30
#连接池最小连接数
oracle.minPoolSize=5
#连接池初始连接数
oracle.initialPoolSize=5
#连接池连接空闲时间
oracle.maxIdleTime=10000

检查了java程序,程序中用到了大量preparedstatement,但是最后都有采取关闭(可以保证);
本地测试时不会出现这种情况,但现上线了会出现,会不会跟服务器压力过大有关?

问题补充:
7454103 写道
引用
but, if your application uses Statement caching, you might try upgrading to c3p0-0.9.0-pre6. Earlier versions of c3p0 closed cached PreparedStatements and their parent Connections asynchronously, such that the order of the closes was not guaranteed, Statements could be closed after or simultaneous to parent Connect close.

More recent versions of c3p0 ensure that all cached PreparedStatements are closed prior calling Connection close. This may eliminate the stack traces that you're seeing.

Anyway, give c3p0-0.9.0-pre6 a shot...

c3p0 你的版本多少?


版本是0.9.1.2
 
2012年5月16日 10:50

1个答案 按时间排序 按投票排序

0 0

引用
but, if your application uses Statement caching, you might try upgrading to c3p0-0.9.0-pre6. Earlier versions of c3p0 closed cached PreparedStatements and their parent Connections asynchronously, such that the order of the closes was not guaranteed, Statements could be closed after or simultaneous to parent Connect close.

More recent versions of c3p0 ensure that all cached PreparedStatements are closed prior calling Connection close. This may eliminate the stack traces that you're seeing.

Anyway, give c3p0-0.9.0-pre6 a shot...

c3p0 你的版本多少?

2012年5月16日 13:44

相关推荐

Global site tag (gtag.js) - Google Analytics