Я использую hibernate 5.1.0 и c3p0 0.9.5.1.У меня не включено кэширование, и я получаю ошибку Apparent Deadlock
.
(C3P0PooledConnectionPoolManager[identityToken->2v2d5k9y3ipope1s0apgi|4b76251c]-AdminTaskTimer) com.mchange.v2.async.ThreadPoolAsynchronousRunner: com.mchange.v2.async.ThreadPoolAsynchronousRunner$DeadlockDetector@2a94bd11 -- APPARENT DEADLOCK!!! Complete Status:
Managed Threads: 3
Active Threads: 3
Active Tasks:
com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@2ece5321
on thread: C3P0PooledConnectionPoolManager[identityToken->2v2d5k9y3ipope1s0apgi|4b76251c]-HelperThread-#2
com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@736e6fcf
on thread: C3P0PooledConnectionPoolManager[identityToken->2v2d5k9y3ipope1s0apgi|4b76251c]-HelperThread-#1
com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@5ceffb3c
on thread: C3P0PooledConnectionPoolManager[identityToken->2v2d5k9y3ipope1s0apgi|4b76251c]-HelperThread-#0
Pending Tasks:
com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@75425131
com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@29c943e3
com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@29d94102
com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@a4c691e
com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@6d606abf
com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@ed5eaab
com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@6de76b22
com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@40aeb19
com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@6a514cb5
com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@4b7073e6
com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@1d18afd1
com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@4e19dd48
com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@2ecd04da
com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@666abda6
com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@3ed4e09d
com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@3ea78992
com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@788aa148
com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@4bbea472
com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@52f76590
com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@509e9d45
Pool thread stack traces:
Thread[C3P0PooledConnectionPoolManager[identityToken->2v2d5k9y3ipope1s0apgi|4b76251c]-HelperThread-#2,5,main]
java.net.PlainSocketImpl.socketConnect(Native Method)
java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
java.net.Socket.connect(Socket.java:589)
java.net.Socket.connect(Socket.java:538)
java.net.Socket.<init>(Socket.java:434)
java.net.Socket.<init>(Socket.java:244)
com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:243)
com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:297)
com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2232)
com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2265)
com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2064)
com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:790)
com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:44)
sun.reflect.GeneratedConstructorAccessor74.newInstance(Unknown Source)
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
java.lang.reflect.Constructor.newInstance(Constructor.java:423)
com.mysql.jdbc.Util.handleNewInstance(Util.java:377)
com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:395)
com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:325)
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)
Мой конфиг c3p0 выглядит так:
hibernate.connection.provider_class = "org.hibernate.c3p0.internal.C3P0ConnectionProvider";
hibernate.c3p0.min_size = "200";
hibernate.c3p0.max_size = "200";
hibernate.c3p0.idle_test_period = "100";
hibernate.c3p0.max_statements = "0";
hibernate.c3p0.timeout = "86400";
hibernate.c3p0.preferredTestQuery = "select 1";
Любая идея, почему я получаю сценарий тупика.Из того, что я прочитал в сети, кеширование является основным виновником этого сценария, если у меня не включено кэширование.