代码如下:
2016-06-30 22:40:38 [WARN]-[Thread: C3P0PooledConnectionPoolManager[identityToken-> 1hge15w9h18tqorr1ltqcj|33d5cdd]-AdminTaskTimer]- [com.mchange.v2.async.ThreadPoolAsynchronousRunner$DeadlockDetector.run()] : com.mchange.v2.async.ThreadPoolAsynchronousRunner$DeadlockDetector@4f6d8d30 -- APPARENT DEADLOCK!!! Creating emergency threads for unassigned pending tasks! 2016-06-30 22:40:38 [WARN]-[Thread: C3P0PooledConnectionPoolManager[identityToken-> 1hge15w9h18tqorr1ltqcj|33d5cdd]-AdminTaskTimer]- [com.mchange.v2.async.ThreadPoolAsynchronousRunner$DeadlockDetector.run()] : com.mchange.v2.async.ThreadPoolAsynchronousRunner$DeadlockDetector@4f6d8d30 -- APPARENT DEADLOCK!!! Complete Status: Managed Threads: 3 Active Threads: 3 Active Tasks: com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@41b09cda on thread: C3P0PooledConnectionPoolManager[identityToken->1hge15w9h18tqorr1ltqcj|33d5cdd]-HelperThread-#2 com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@3209cde7 on thread: C3P0PooledConnectionPoolManager[identityToken->1hge15w9h18tqorr1ltqcj|33d5cdd]-HelperThread-#0 com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@21ad125b on thread: C3P0PooledConnectionPoolManager[identityToken->1hge15w9h18tqorr1ltqcj|33d5cdd]-HelperThread-#1 Pending Tasks: com.mchange.v2.resourcepool.BasicResourcePool$1DestroyResourceTask@699025a2 com.mchange.v2.resourcepool.BasicResourcePool$1DestroyResourceTask@7696e4d2 com.mchange.v2.resourcepool.BasicResourcePool$1DestroyResourceTask@2c88d3d1 com.mchange.v2.resourcepool.BasicResourcePool$1DestroyResourceTask@4b0a552e com.mchange.v2.resourcepool.BasicResourcePool$1DestroyResourceTask@135e657f com.mchange.v2.resourcepool.BasicResourcePool$1DestroyResourceTask@1a597ec8 com.mchange.v2.resourcepool.BasicResourcePool$1DestroyResourceTask@699289fb com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@13a0f3e3 com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@2bebc626 com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@41dff51 com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@4d6520f3 com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@2a565937 com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@afb3f98 com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@750c19c9 Pool thread stack traces: Thread[C3P0PooledConnectionPoolManager[identityToken->1hge15w9h18tqorr1ltqcj|33d5cdd]-HelperThread-#1,5,main] java.net.SocketInputStream.socketRead0(Native Method) java.net.SocketInputStream.read(SocketInputStream.java:152) java.net.SocketInputStream.read(SocketInputStream.java:122) com.mysql.jdbc.util.ReadAheadInputStream.fill(ReadAheadInputStream.java:114) com.mysql.jdbc.util.ReadAheadInputStream.readFromUnderlyingStreamIfNecessary(ReadAheadInputStream.java:161) com.mysql.jdbc.util.ReadAheadInputStream.read(ReadAheadInputStream.java:189) com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:3036) com.mysql.jdbc.MysqlIO.readPacket(MysqlIO.java:624) com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1110) com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2395) com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2428) com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2213) com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:797) com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:47) sun.reflect.GeneratedConstructorAccessor41.newInstance(Unknown Source) sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) java.lang.reflect.Constructor.newInstance(Constructor.java:526) com.mysql.jdbc.Util.handleNewInstance(Util.java:411) com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:389) com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:305) com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:175) com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:220) com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:206) com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:203) com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1138) com.mchange.v2.resourcepool.BasicResourcePool.doAcquireAndDecrementPendingAcquiresWithinLockOnSuccess(BasicResourcePool.java:1125) com.mchange.v2.resourcepool.BasicResourcePool.access$700(BasicResourcePool.java:44) com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask.run(BasicResourcePool.java:1870) com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:696) Thread[C3P0PooledConnectionPoolManager[identityToken->1hge15w9h18tqorr1ltqcj|33d5cdd]-HelperThread-#0,5,main] java.net.SocketInputStream.socketRead0(Native Method) java.net.SocketInputStream.read(SocketInputStream.java:152) java.net.SocketInputStream.read(SocketInputStream.java:122) com.mysql.jdbc.util.ReadAheadInputStream.fill(ReadAheadInputStream.java:114) com.mysql.jdbc.util.ReadAheadInputStream.readFromUnderlyingStreamIfNecessary(ReadAheadInputStream.java:161) com.mysql.jdbc.util.ReadAheadInputStream.read(ReadAheadInputStream.java:189) com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:3036) com.mysql.jdbc.MysqlIO.readPacket(MysqlIO.java:624) com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1110) com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2395) com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2428) com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2213) com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:797) com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:47) sun.reflect.GeneratedConstructorAccessor41.newInstance(Unknown Source) sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) java.lang.reflect.Constructor.newInstance(Constructor.java:526) com.mysql.jdbc.Util.handleNewInstance(Util.java:411) com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:389) com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:305) com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:175) com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:220) com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:206) com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:203) com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1138) com.mchange.v2.resourcepool.BasicResourcePool.doAcquireAndDecrementPendingAcquiresWithinLockOnSuccess(BasicResourcePool.java:1125) com.mchange.v2.resourcepool.BasicResourcePool.access$700(BasicResourcePool.java:44) com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask.run(BasicResourcePool.java:1870) com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:696) Thread[C3P0PooledConnectionPoolManager[identityToken->1hge15w9h18tqorr1ltqcj|33d5cdd]-HelperThread-#2,5,main] java.net.SocketInputStream.socketRead0(Native Method) java.net.SocketInputStream.read(SocketInputStream.java:152) java.net.SocketInputStream.read(SocketInputStream.java:122) com.mysql.jdbc.util.ReadAheadInputStream.fill(ReadAheadInputStream.java:114) com.mysql.jdbc.util.ReadAheadInputStream.readFromUnderlyingStreamIfNecessary(ReadAheadInputStream.java:161) com.mysql.jdbc.util.ReadAheadInputStream.read(ReadAheadInputStream.java:189) com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:3036) com.mysql.jdbc.MysqlIO.readPacket(MysqlIO.java:624) com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1110) com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2395) com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2428) com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2213) com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:797) com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:47) sun.reflect.GeneratedConstructorAccessor41.newInstance(Unknown Source) sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) java.lang.reflect.Constructor.newInstance(Constructor.java:526) com.mysql.jdbc.Util.handleNewInstance(Util.java:411) com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:389) com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:305) com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:175) com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:220) com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:206) com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:203) com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1138) com.mchange.v2.resourcepool.BasicResourcePool.doAcquireAndDecrementPendingAcquiresWithinLockOnSuccess(BasicResourcePool.java:1125) com.mchange.v2.resourcepool.BasicResourcePool.access$700(BasicResourcePool.java:44) com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask.run(BasicResourcePool.java:1870) com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:696) 2016-06-30 22:41:38 [WARN]-[Thread: C3P0PooledConnectionPoolManager[identityToken->1hge15w9h18tqorr1ltqcj|33d5cdd]-AdminTaskTimer]-[com.mchange.v2.async.ThreadPoolAsynchronousRunner.processReplacedThreads()]: Task com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@21ad125b (in deadlocked PoolThread) failed to complete in maximum time 60000ms. Trying interrupt(). 2016-06-30 22:41:38 [WARN]-[Thread: C3P0PooledConnectionPoolManager[identityToken->1hge15w9h18tqorr1ltqcj|33d5cdd]-AdminTaskTimer]-[com.mchange.v2.async.ThreadPoolAsynchronousRunner.processReplacedThreads()]: Task com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@3209cde7 (in deadlocked PoolThread) failed to complete in maximum time 60000ms. Trying interrupt(). 2016-06-30 22:41:38 [WARN]-[Thread: C3P0PooledConnectionPoolManager[identityToken->1hge15w9h18tqorr1ltqcj|33d5cdd]-AdminTaskTimer]-[com.mchange.v2.async.ThreadPoolAsynchronousRunner.processReplacedThreads()]: Task com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@41b09cda (in deadlocked PoolThread) failed to complete in maximum time 60000ms. Trying interrupt().