我正在使用Hibernate 4和C3P0作为其连接提供程序。我目前没有使用 Spring框架。
开发环境
Windows 7
Eclipse Juno
JRE-7
JDK -7
我正在使用的罐子......
hibernate-core-4.1.7.Final.jar
c3p0-0.9.2-pre6.jar
jtds-1.3.0.jar
但在同一个lib路径中也有
hibernate-c3p0-4.1.1.Final.jar
spring-orm-3.2.0.RC1.jar
那些其他jar(hibernate-c3p0-4.1.1.Final.jar和spring-orm-3.2.0.RC1.jar)是否有可能对此错误产生一些影响(见下文)?? < / p>
是的,整个春天的框架罐子都在路上,但我只是想 习惯先休眠。我还不知道如何使用Spring。我们暂时把这件事留在这里。
我可以针对数据库成功创建连接和查询。 但是我得到了这个错误
类似
Some resources failed to close properly while closing com.mchange.v2.c3p0.impl.NewPooledConnection@4d0106e5
和
WARNING: Failed to destroy resource: com.mchange.v2.c3p0.impl.NewPooledConnection@4d0106e5
我得到的错误非常重复。 他们都看起来像这样
11월 30, 2012 4:39:59 오후 com.mchange.v2.c3p0.impl.NewPooledConnection logCloseExceptions
INFO: [c3p0] Exceptions occurred while trying to close a PooledConnection's resources normally.
11월 30, 2012 4:39:59 오후 com.mchange.v2.c3p0.impl.NewPooledConnection logCloseExceptions
INFO: [c3p0] NewPooledConnection close Exception.
java.sql.SQLException: I/O Error: Stream 2 attempting to read when no request has been sent
at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2388)
at net.sourceforge.jtds.jdbc.TdsCore.clearResponseQueue(TdsCore.java:736)
at net.sourceforge.jtds.jdbc.JtdsStatement.reset(JtdsStatement.java:722)
at net.sourceforge.jtds.jdbc.JtdsStatement.close(JtdsStatement.java:966)
at com.mchange.v2.c3p0.impl.NewPooledConnection.cleanupUncachedStatements(NewPooledConnection.java:718)
at com.mchange.v2.c3p0.impl.NewPooledConnection.close(NewPooledConnection.java:592)
at com.mchange.v2.c3p0.impl.NewPooledConnection.closeMaybeCheckedOut(NewPooledConnection.java:247)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.destroyResource(C3P0PooledConnectionPool.java:607)
at com.mchange.v2.resourcepool.BasicResourcePool$1DestroyResourceTask.run(BasicResourcePool.java:1012)
at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:636)
Caused by: java.io.IOException: Stream 2 attempting to read when no request has been sent
at net.sourceforge.jtds.jdbc.SharedSocket.getNetPacket(SharedSocket.java:755)
at net.sourceforge.jtds.jdbc.ResponseStream.getPacket(ResponseStream.java:477)
at net.sourceforge.jtds.jdbc.ResponseStream.read(ResponseStream.java:114)
at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2282)
... 9 more
11월 30, 2012 4:39:59 오후 com.mchange.v2.resourcepool.BasicResourcePool$1DestroyResourceTask run
WARNING: Failed to destroy resource: com.mchange.v2.c3p0.impl.NewPooledConnection@4d0106e5
java.sql.SQLException: Some resources failed to close properly while closing com.mchange.v2.c3p0.impl.NewPooledConnection@4d0106e5
at com.mchange.v2.c3p0.impl.NewPooledConnection.close(NewPooledConnection.java:638)
at com.mchange.v2.c3p0.impl.NewPooledConnection.closeMaybeCheckedOut(NewPooledConnection.java:247)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.destroyResource(C3P0PooledConnectionPool.java:607)
at com.mchange.v2.resourcepool.BasicResourcePool$1DestroyResourceTask.run(BasicResourcePool.java:1012)
at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:636)
11월 30, 2012 4:42:17 오후 com.mchange.v2.c3p0.impl.NewPooledConnection logCloseExceptions
INFO: [c3p0] Exceptions occurred while trying to close a PooledConnection's resources normally.
11월 30, 2012 4:42:17 오후 com.mchange.v2.c3p0.impl.NewPooledConnection logCloseExceptions
INFO: [c3p0] NewPooledConnection close Exception.
java.sql.SQLException: I/O Error: Stream 2 attempting to read when no request has been sent
at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2388)
at net.sourceforge.jtds.jdbc.TdsCore.clearResponseQueue(TdsCore.java:736)
at net.sourceforge.jtds.jdbc.JtdsStatement.reset(JtdsStatement.java:722)
at net.sourceforge.jtds.jdbc.JtdsStatement.close(JtdsStatement.java:966)
at com.mchange.v2.c3p0.impl.NewPooledConnection.cleanupUncachedStatements(NewPooledConnection.java:718)
at com.mchange.v2.c3p0.impl.NewPooledConnection.close(NewPooledConnection.java:592)
at com.mchange.v2.c3p0.impl.NewPooledConnection.closeMaybeCheckedOut(NewPooledConnection.java:247)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.destroyResource(C3P0PooledConnectionPool.java:607)
at com.mchange.v2.resourcepool.BasicResourcePool$1DestroyResourceTask.run(BasicResourcePool.java:1012)
at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:636)
Caused by: java.io.IOException: Stream 2 attempting to read when no request has been sent
at net.sourceforge.jtds.jdbc.SharedSocket.getNetPacket(SharedSocket.java:755)
at net.sourceforge.jtds.jdbc.ResponseStream.getPacket(ResponseStream.java:477)
at net.sourceforge.jtds.jdbc.ResponseStream.read(ResponseStream.java:114)
at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2282)
... 9 more
11월 30, 2012 4:42:17 오후 com.mchange.v2.resourcepool.BasicResourcePool$1DestroyResourceTask run
WARNING: Failed to destroy resource: com.mchange.v2.c3p0.impl.NewPooledConnection@40a4d015
java.sql.SQLException: Some resources failed to close properly while closing com.mchange.v2.c3p0.impl.NewPooledConnection@40a4d015
at com.mchange.v2.c3p0.impl.NewPooledConnection.close(NewPooledConnection.java:638)
at com.mchange.v2.c3p0.impl.NewPooledConnection.closeMaybeCheckedOut(NewPooledConnection.java:247)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.destroyResource(C3P0PooledConnectionPool.java:607)
at com.mchange.v2.resourcepool.BasicResourcePool$1DestroyResourceTask.run(BasicResourcePool.java:1012)
at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:636)
11월 30, 2012 4:42:17 오후 com.mchange.v2.c3p0.impl.NewPooledConnection logCloseExceptions
INFO: [c3p0] Exceptions occurred while trying to close a PooledConnection's resources normally.
11월 30, 2012 4:42:17 오후 com.mchange.v2.c3p0.impl.NewPooledConnection logCloseExceptions
INFO: [c3p0] NewPooledConnection close Exception.
java.sql.SQLException: I/O Error: Stream 2 attempting to read when no request has been sent
at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2388)
at net.sourceforge.jtds.jdbc.TdsCore.clearResponseQueue(TdsCore.java:736)
at net.sourceforge.jtds.jdbc.JtdsStatement.reset(JtdsStatement.java:722)
at net.sourceforge.jtds.jdbc.JtdsStatement.close(JtdsStatement.java:966)
at com.mchange.v2.c3p0.impl.NewPooledConnection.cleanupUncachedStatements(NewPooledConnection.java:718)
at com.mchange.v2.c3p0.impl.NewPooledConnection.close(NewPooledConnection.java:592)
at com.mchange.v2.c3p0.impl.NewPooledConnection.closeMaybeCheckedOut(NewPooledConnection.java:247)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.destroyResource(C3P0PooledConnectionPool.java:607)
at com.mchange.v2.resourcepool.BasicResourcePool$1DestroyResourceTask.run(BasicResourcePool.java:1012)
at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:636)
Caused by: java.io.IOException: Stream 2 attempting to read when no request has been sent
at net.sourceforge.jtds.jdbc.SharedSocket.getNetPacket(SharedSocket.java:755)
at net.sourceforge.jtds.jdbc.ResponseStream.getPacket(ResponseStream.java:477)
at net.sourceforge.jtds.jdbc.ResponseStream.read(ResponseStream.java:114)
at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2282)
... 9 more
11월 30, 2012 4:42:17 오후 com.mchange.v2.resourcepool.BasicResourcePool$1DestroyResourceTask run
WARNING: Failed to destroy resource: com.mchange.v2.c3p0.impl.NewPooledConnection@2ee657fa
java.sql.SQLException: Some resources failed to close properly while closing com.mchange.v2.c3p0.impl.NewPooledConnection@2ee657fa
at com.mchange.v2.c3p0.impl.NewPooledConnection.close(NewPooledConnection.java:638)
at com.mchange.v2.c3p0.impl.NewPooledConnection.closeMaybeCheckedOut(NewPooledConnection.java:247)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.destroyResource(C3P0PooledConnectionPool.java:607)
at com.mchange.v2.resourcepool.BasicResourcePool$1DestroyResourceTask.run(BasicResourcePool.java:1012)
at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:636)
11월 30, 2012 4:42:18 오후 com.mchange.v2.c3p0.impl.NewPooledConnection logCloseExceptions
INFO: [c3p0] Exceptions occurred while trying to close a PooledConnection's resources normally.
11월 30, 2012 4:42:18 오후 com.mchange.v2.c3p0.impl.NewPooledConnection logCloseExceptions
INFO: [c3p0] NewPooledConnection close Exception.
java.sql.SQLException: I/O Error: Stream 2 attempting to read when no request has been sent
at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2388)
at net.sourceforge.jtds.jdbc.TdsCore.clearResponseQueue(TdsCore.java:736)
at net.sourceforge.jtds.jdbc.JtdsStatement.reset(JtdsStatement.java:722)
at net.sourceforge.jtds.jdbc.JtdsStatement.close(JtdsStatement.java:966)
at com.mchange.v2.c3p0.impl.NewPooledConnection.cleanupUncachedStatements(NewPooledConnection.java:718)
at com.mchange.v2.c3p0.impl.NewPooledConnection.close(NewPooledConnection.java:592)
at com.mchange.v2.c3p0.impl.NewPooledConnection.closeMaybeCheckedOut(NewPooledConnection.java:247)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.destroyResource(C3P0PooledConnectionPool.java:607)
at com.mchange.v2.resourcepool.BasicResourcePool$1DestroyResourceTask.run(BasicResourcePool.java:1012)
at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:636)
Caused by: java.io.IOException: Stream 2 attempting to read when no request has been sent
at net.sourceforge.jtds.jdbc.SharedSocket.getNetPacket(SharedSocket.java:755)
at net.sourceforge.jtds.jdbc.ResponseStream.getPacket(ResponseStream.java:477)
at net.sourceforge.jtds.jdbc.ResponseStream.read(ResponseStream.java:114)
at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2282)
... 9 more
11월 30, 2012 4:42:18 오후 com.mchange.v2.resourcepool.BasicResourcePool$1DestroyResourceTask run
WARNING: Failed to destroy resource: com.mchange.v2.c3p0.impl.NewPooledConnection@51b2f91b
java.sql.SQLException: Some resources failed to close properly while closing com.mchange.v2.c3p0.impl.NewPooledConnection@51b2f91b
at com.mchange.v2.c3p0.impl.NewPooledConnection.close(NewPooledConnection.java:638)
at com.mchange.v2.c3p0.impl.NewPooledConnection.closeMaybeCheckedOut(NewPooledConnection.java:247)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.destroyResource(C3P0PooledConnectionPool.java:607)
at com.mchange.v2.resourcepool.BasicResourcePool$1DestroyResourceTask.run(BasicResourcePool.java:1012)
at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:636)
11월 30, 2012 4:42:19 오후 com.mchange.v2.c3p0.impl.NewPooledConnection logCloseExceptions
INFO: [c3p0] Exceptions occurred while trying to close a PooledConnection's resources normally.
11월 30, 2012 4:42:19 오후 com.mchange.v2.c3p0.impl.NewPooledConnection logCloseExceptions
INFO: [c3p0] NewPooledConnection close Exception.
java.sql.SQLException: I/O Error: Stream 2 attempting to read when no request has been sent
at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2388)
at net.sourceforge.jtds.jdbc.TdsCore.clearResponseQueue(TdsCore.java:736)
at net.sourceforge.jtds.jdbc.JtdsStatement.reset(JtdsStatement.java:722)
at net.sourceforge.jtds.jdbc.JtdsStatement.close(JtdsStatement.java:966)
at com.mchange.v2.c3p0.impl.NewPooledConnection.cleanupUncachedStatements(NewPooledConnection.java:718)
at com.mchange.v2.c3p0.impl.NewPooledConnection.close(NewPooledConnection.java:592)
at com.mchange.v2.c3p0.impl.NewPooledConnection.closeMaybeCheckedOut(NewPooledConnection.java:247)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.destroyResource(C3P0PooledConnectionPool.java:607)
at com.mchange.v2.resourcepool.BasicResourcePool$1DestroyResourceTask.run(BasicResourcePool.java:1012)
at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:636)
Caused by: java.io.IOException: Stream 2 attempting to read when no request has been sent
at net.sourceforge.jtds.jdbc.SharedSocket.getNetPacket(SharedSocket.java:755)
at net.sourceforge.jtds.jdbc.ResponseStream.getPacket(ResponseStream.java:477)
at net.sourceforge.jtds.jdbc.ResponseStream.read(ResponseStream.java:114)
at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2282)
... 9 more
11월 30, 2012 4:42:19 오후 com.mchange.v2.resourcepool.BasicResourcePool$1DestroyResourceTask run
WARNING: Failed to destroy resource: com.mchange.v2.c3p0.impl.NewPooledConnection@7bb39e5e
java.sql.SQLException: Some resources failed to close properly while closing com.mchange.v2.c3p0.impl.NewPooledConnection@7bb39e5e
at com.mchange.v2.c3p0.impl.NewPooledConnection.close(NewPooledConnection.java:638)
at com.mchange.v2.c3p0.impl.NewPooledConnection.closeMaybeCheckedOut(NewPooledConnection.java:247)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.destroyResource(C3P0PooledConnectionPool.java:607)
at com.mchange.v2.resourcepool.BasicResourcePool$1DestroyResourceTask.run(BasicResourcePool.java:1012)
at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:636)
11월 30, 2012 4:42:21 오후 com.mchange.v2.c3p0.impl.NewPooledConnection logCloseExceptions
INFO: [c3p0] Exceptions occurred while trying to close a PooledConnection's resources normally.
11월 30, 2012 4:42:21 오후 com.mchange.v2.c3p0.impl.NewPooledConnection logCloseExceptions
INFO: [c3p0] NewPooledConnection close Exception.
java.sql.SQLException: I/O Error: Stream 2 attempting to read when no request has been sent
at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2388)
at net.sourceforge.jtds.jdbc.TdsCore.clearResponseQueue(TdsCore.java:736)
at net.sourceforge.jtds.jdbc.JtdsStatement.reset(JtdsStatement.java:722)
at net.sourceforge.jtds.jdbc.JtdsStatement.close(JtdsStatement.java:966)
at com.mchange.v2.c3p0.impl.NewPooledConnection.cleanupUncachedStatements(NewPooledConnection.java:718)
at com.mchange.v2.c3p0.impl.NewPooledConnection.close(NewPooledConnection.java:592)
at com.mchange.v2.c3p0.impl.NewPooledConnection.closeMaybeCheckedOut(NewPooledConnection.java:247)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.destroyResource(C3P0PooledConnectionPool.java:607)
at com.mchange.v2.resourcepool.BasicResourcePool$1DestroyResourceTask.run(BasicResourcePool.java:1012)
at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:636)
Caused by: java.io.IOException: Stream 2 attempting to read when no request has been sent
at net.sourceforge.jtds.jdbc.SharedSocket.getNetPacket(SharedSocket.java:755)
at net.sourceforge.jtds.jdbc.ResponseStream.getPacket(ResponseStream.java:477)
at net.sourceforge.jtds.jdbc.ResponseStream.read(ResponseStream.java:114)
at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2282)
... 9 more
11월 30, 2012 4:42:21 오후 com.mchange.v2.resourcepool.BasicResourcePool$1DestroyResourceTask run
WARNING: Failed to destroy resource: com.mchange.v2.c3p0.impl.NewPooledConnection@155767ad
java.sql.SQLException: Some resources failed to close properly while closing com.mchange.v2.c3p0.impl.NewPooledConnection@155767ad
at com.mchange.v2.c3p0.impl.NewPooledConnection.close(NewPooledConnection.java:638)
at com.mchange.v2.c3p0.impl.NewPooledConnection.closeMaybeCheckedOut(NewPooledConnection.java:247)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.destroyResource(C3P0PooledConnectionPool.java:607)
at com.mchange.v2.resourcepool.BasicResourcePool$1DestroyResourceTask.run(BasicResourcePool.java:1012)
at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:636)
11월 30, 2012 4:42:22 오후 com.mchange.v2.c3p0.impl.NewPooledConnection logCloseExceptions
INFO: [c3p0] Exceptions occurred while trying to close a PooledConnection's resources normally.
11월 30, 2012 4:42:22 오후 com.mchange.v2.c3p0.impl.NewPooledConnection logCloseExceptions
INFO: [c3p0] NewPooledConnection close Exception.
java.sql.SQLException: I/O Error: Stream 2 attempting to read when no request has been sent
at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2388)
at net.sourceforge.jtds.jdbc.TdsCore.clearResponseQueue(TdsCore.java:736)
at net.sourceforge.jtds.jdbc.JtdsStatement.reset(JtdsStatement.java:722)
at net.sourceforge.jtds.jdbc.JtdsStatement.close(JtdsStatement.java:966)
at com.mchange.v2.c3p0.impl.NewPooledConnection.cleanupUncachedStatements(NewPooledConnection.java:718)
at com.mchange.v2.c3p0.impl.NewPooledConnection.close(NewPooledConnection.java:592)
at com.mchange.v2.c3p0.impl.NewPooledConnection.closeMaybeCheckedOut(NewPooledConnection.java:247)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.destroyResource(C3P0PooledConnectionPool.java:607)
at com.mchange.v2.resourcepool.BasicResourcePool$1DestroyResourceTask.run(BasicResourcePool.java:1012)
at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:636)
Caused by: java.io.IOException: Stream 2 attempting to read when no request has been sent
at net.sourceforge.jtds.jdbc.SharedSocket.getNetPacket(SharedSocket.java:755)
at net.sourceforge.jtds.jdbc.ResponseStream.getPacket(ResponseStream.java:477)
at net.sourceforge.jtds.jdbc.ResponseStream.read(ResponseStream.java:114)
at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2282)
... 9 more
11월 30, 2012 4:42:22 오후 com.mchange.v2.resourcepool.BasicResourcePool$1DestroyResourceTask run
WARNING: Failed to destroy resource: com.mchange.v2.c3p0.impl.NewPooledConnection@299bdc58
java.sql.SQLException: Some resources failed to close properly while closing com.mchange.v2.c3p0.impl.NewPooledConnection@299bdc58
at com.mchange.v2.c3p0.impl.NewPooledConnection.close(NewPooledConnection.java:638)
at com.mchange.v2.c3p0.impl.NewPooledConnection.closeMaybeCheckedOut(NewPooledConnection.java:247)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.destroyResource(C3P0PooledConnectionPool.java:607)
at com.mchange.v2.resourcepool.BasicResourcePool$1DestroyResourceTask.run(BasicResourcePool.java:1012)
at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:636)
11월 30, 2012 4:42:22 오후 com.mchange.v2.c3p0.impl.NewPooledConnection logCloseExceptions
INFO: [c3p0] Exceptions occurred while trying to close a PooledConnection's resources normally.
11월 30, 2012 4:42:22 오후 com.mchange.v2.c3p0.impl.NewPooledConnection logCloseExceptions
INFO: [c3p0] NewPooledConnection close Exception.
java.sql.SQLException: I/O Error: Stream 2 attempting to read when no request has been sent
at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2388)
at net.sourceforge.jtds.jdbc.TdsCore.clearResponseQueue(TdsCore.java:736)
at net.sourceforge.jtds.jdbc.JtdsStatement.reset(JtdsStatement.java:722)
at net.sourceforge.jtds.jdbc.JtdsStatement.close(JtdsStatement.java:966)
at com.mchange.v2.c3p0.impl.NewPooledConnection.cleanupUncachedStatements(NewPooledConnection.java:718)
at com.mchange.v2.c3p0.impl.NewPooledConnection.close(NewPooledConnection.java:592)
at com.mchange.v2.c3p0.impl.NewPooledConnection.closeMaybeCheckedOut(NewPooledConnection.java:247)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.destroyResource(C3P0PooledConnectionPool.java:607)
at com.mchange.v2.resourcepool.BasicResourcePool$1DestroyResourceTask.run(BasicResourcePool.java:1012)
at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:636)
Caused by: java.io.IOException: Stream 2 attempting to read when no request has been sent
at net.sourceforge.jtds.jdbc.SharedSocket.getNetPacket(SharedSocket.java:755)
at net.sourceforge.jtds.jdbc.ResponseStream.getPacket(ResponseStream.java:477)
at net.sourceforge.jtds.jdbc.ResponseStream.read(ResponseStream.java:114)
at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2282)
... 9 more
11월 30, 2012 4:42:22 오후 com.mchange.v2.resourcepool.BasicResourcePool$1DestroyResourceTask run
WARNING: Failed to destroy resource: com.mchange.v2.c3p0.impl.NewPooledConnection@550a9854
java.sql.SQLException: Some resources failed to close properly while closing com.mchange.v2.c3p0.impl.NewPooledConnection@550a9854
at com.mchange.v2.c3p0.impl.NewPooledConnection.close(NewPooledConnection.java:638)
at com.mchange.v2.c3p0.impl.NewPooledConnection.closeMaybeCheckedOut(NewPooledConnection.java:247)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.destroyResource(C3P0PooledConnectionPool.java:607)
at com.mchange.v2.resourcepool.BasicResourcePool$1DestroyResourceTask.run(BasicResourcePool.java:1012)
at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:636)
11월 30, 2012 4:42:22 오후 com.mchange.v2.c3p0.impl.NewPooledConnection logCloseExceptions
INFO: [c3p0] Exceptions occurred while trying to close a PooledConnection's resources normally.
11월 30, 2012 4:42:22 오후 com.mchange.v2.c3p0.impl.NewPooledConnection logCloseExceptions
INFO: [c3p0] NewPooledConnection close Exception.
java.sql.SQLException: I/O Error: Stream 2 attempting to read when no request has been sent
at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2388)
at net.sourceforge.jtds.jdbc.TdsCore.clearResponseQueue(TdsCore.java:736)
at net.sourceforge.jtds.jdbc.JtdsStatement.reset(JtdsStatement.java:722)
at net.sourceforge.jtds.jdbc.JtdsStatement.close(JtdsStatement.java:966)
at com.mchange.v2.c3p0.impl.NewPooledConnection.cleanupUncachedStatements(NewPooledConnection.java:718)
at com.mchange.v2.c3p0.impl.NewPooledConnection.close(NewPooledConnection.java:592)
at com.mchange.v2.c3p0.impl.NewPooledConnection.closeMaybeCheckedOut(NewPooledConnection.java:247)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.destroyResource(C3P0PooledConnectionPool.java:607)
at com.mchange.v2.resourcepool.BasicResourcePool$1DestroyResourceTask.run(BasicResourcePool.java:1012)
at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:636)
Caused by: java.io.IOException: Stream 2 attempting to read when no request has been sent
at net.sourceforge.jtds.jdbc.SharedSocket.getNetPacket(SharedSocket.java:755)
at net.sourceforge.jtds.jdbc.ResponseStream.getPacket(ResponseStream.java:477)
at net.sourceforge.jtds.jdbc.ResponseStream.read(ResponseStream.java:114)
at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2282)
... 9 more
11월 30, 2012 4:42:22 오후 com.mchange.v2.resourcepool.BasicResourcePool$1DestroyResourceTask run
WARNING: Failed to destroy resource: com.mchange.v2.c3p0.impl.NewPooledConnection@67a80f8e
java.sql.SQLException: Some resources failed to close properly while closing com.mchange.v2.c3p0.impl.NewPooledConnection@67a80f8e
at com.mchange.v2.c3p0.impl.NewPooledConnection.close(NewPooledConnection.java:638)
at com.mchange.v2.c3p0.impl.NewPooledConnection.closeMaybeCheckedOut(NewPooledConnection.java:247)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.destroyResource(C3P0PooledConnectionPool.java:607)
at com.mchange.v2.resourcepool.BasicResourcePool$1DestroyResourceTask.run(BasicResourcePool.java:1012)
at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:636)
提前致谢。 让我知道,如果我能提高几点,我可以改进写一个问题:)
EDIT 哎呀我忘了粘贴我的配置。
<hibernate-configuration>
<session-factory>
<!-- Database connection settings -->
<property name="connection.driver_class">net.sourceforge.jtds.jdbc.Driver</property>
<!-- -->
<!-- JDBC connection pool (use the built-in) -->
<property name="connection.pool_size">5</property>
<!-- connection pooling -->
<property name="connection.provider_class">org.hibernate.connection.C3P0ConnectionProvider</property>
<!--
<property name="connection.provider_class">org.hibernate.connection.C3P0ConnectionProvider</property>
-->
<property name="hibernate.c3p0.acquire_increment" >1</property>
<property name="hibernate.c3p0.idle_test_period">30</property>
<property name="hibernate.c3p0.min_size">1</property>
<property name="hibernate.c3p0.max_size">2</property>
<property name="hibernate.c3p0.max_statements">50</property>
<property name="hibernate.c3p0.timeout">60</property>
<!--
<property name="hibernate.c3p0.acquireRetryAttempts">1</property>
<property name="hibernate.c3p0.acquireRetryDelay">250</property>
-->
<!-- SQL dialect -->
<!--
<property name="dialect">org.hibernate.dialect.SQLServerDialect</property>
-->
<!-- Enable Hibernate's automatic session context management -->
<property name="current_session_context_class">thread</property>
<!-- Disable the second-level cache -->
<property name="cache.provider_class">org.hibernate.cache.NoCacheProvider</property>
<!-- Echo all executed SQL to stdout -->
<property name="show_sql">true</property>
<!-- Drop and re-create the database schema on startup -->
<!-- <property name="hbm2ddl.auto">update</property> -->
<!-- Mapping files -->
<mapping resource="standard.hbm.xml"/>
<mapping resource="revisionedFile.hbm.xml"/>
<mapping resource="keyword.hbm.xml"/>
<mapping resource="device.hbm.xml"/>
<mapping resource="reference.hbm.xml"/>
<mapping resource="commonSpecification.hbm.xml"/>
<mapping resource="item.hbm.xml"/>
<mapping resource="superItem.hbm.xml"/>
<mapping resource="defaultURLResource.hbm.xml" />
<mapping resource="test.hbm.xml"/>
<!-- Enver Listeners -->
<listener class="org.hibernate.envers.event.AuditEventListener" type="post-insert"/>
<listener class="org.hibernate.envers.event.AuditEventListener" type="post-update"/>
<listener class="org.hibernate.envers.event.AuditEventListener" type="post-delete"/>
<listener class="org.hibernate.envers.event.AuditEventListener" type="pre-collection-update"/>
<listener class="org.hibernate.envers.event.AuditEventListener" type="pre-collection-remove"/>
<listener class="org.hibernate.envers.event.AuditEventListener" type="post-collection-recreate"/>
</session-factory>
</hibernate-configuration>
答案 0 :(得分:2)
我不确切地知道你为什么会看到异常,但它们是异常,其中c3p0正在清理应由用户关闭但未被用户关闭的语句。解决问题的一种方法(可以解决问题或提供有关问题发生位置的更清晰信息)将确保客户端应用程序在使用它们后立即关闭语句。当您检入Connections时(或者在这种情况下,当从池中删除PooledConnection时),c3p0会小心地为您清除未关闭的语句,但如果出现异常,则在资源期间它们将被报告为异常 - 清理,即在关闭期间()。这就是你所看到的。
当PooledConnection被销毁时,你如何/为什么还要关闭未缓存的语句,这有点神秘。池在检出时不应该尝试关闭()PooledConnection,如果已经签入,则应该在办理登机手续时清理语句。我将向记录器com.mchange.v2.c3p0.impl.NewPooledConnection添加更多日志记录(在FINER / DEBUG级别)到c3p0的下一个预发行版,这可能有助于跟踪此问题。如果你有机会,请看看。