aspose file tools*
The moose likes Object Relational Mapping and the fly likes APPARENT DEADLOCK Hibernate and c3p0 error site goes down please help Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "APPARENT DEADLOCK Hibernate and c3p0 error site goes down please help" Watch "APPARENT DEADLOCK Hibernate and c3p0 error site goes down please help" New topic
Author

APPARENT DEADLOCK Hibernate and c3p0 error site goes down please help

rohit arora
Greenhorn

Joined: Nov 21, 2008
Posts: 6
Hi guys,

I am very new to java and i have just started my job few months back.
I am working on a website which is based on Java,JSP,Struts,MySQL,Hibernate3.0 and i am using c3p0 for connection pooling.
But i get into a APPARENT DEADLOCK very frequently and because of which the site goes down.
I need some help in this
Here is the stack trace of my error and at the end i also have my c3p0 settings in hibernate.cfg.xml

WARN ThreadPoolAsynchronousRunner:624 - com.mchange.v2.async.ThreadPoolAsynchronousRunner$DeadlockDetector@2f7d33ad -- APPARENT DEADLOCK!!! Complete Status:
Managed Threads: 3
Active Threads: 3
Active Tasks:
com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@1b6ff983 (com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#1)
com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@54661587 (com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#0)
com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@7a0f7d5a (com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#2)
Pending Tasks:
com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@eeede51
com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@64459f7f
com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@16ea7e47
com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@7d087311
com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@35baa138
com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@6fae7f16
com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@2919b6a2
com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@57255ac2
com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@5569a340
com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@a5cea8f
com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@5a2b5799
com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@53842c0e
com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@a6875f8
com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@5018f21e
com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@15bfb8a7
com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@5df3e718
com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@37c908d8
com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@6f63b984
com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@7c28c23d
com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@57e87279
com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@5db39305
Pool thread stack traces:
Thread[com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#1,5,main]
java.net.SocketInputStream.socketRead0(Native Method)
java.net.SocketInputStream.read(SocketInputStream.java:129)
com.mysql.jdbc.util.ReadAheadInputStream.fill(ReadAheadInputStream.java:113)
com.mysql.jdbc.util.ReadAheadInputStream.readFromUnderlyingStreamIfNecessary(ReadAheadInputStream.java:160)
com.mysql.jdbc.util.ReadAheadInputStream.read(ReadAheadInputStream.java:188)
com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:1931)
com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2380)
com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2909)
com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1600)
com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1695)
com.mysql.jdbc.Connection.execSQL(Connection.java:3020)
com.mysql.jdbc.Connection.execSQL(Connection.java:2949)
com.mysql.jdbc.Statement.executeQuery(Statement.java:959)
com.mysql.jdbc.Connection.buildCollationMapping(Connection.java:1598)
com.mysql.jdbc.Connection.initializePropsFromServer(Connection.java:3773)
com.mysql.jdbc.Connection.createNewIO(Connection.java:2585)
com.mysql.jdbc.Connection.<init>(Connection.java:1485)
com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:266)
com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:134)
com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:182)
com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:171)
com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:137)
com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1014)
com.mchange.v2.resourcepool.BasicResourcePool.access$800(BasicResourcePool.java:32)
com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask.run(BasicResourcePool.java:1810)
com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:547)
Thread[com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#0,5,main]
java.net.SocketInputStream.socketRead0(Native Method)
java.net.SocketInputStream.read(SocketInputStream.java:129)
com.mysql.jdbc.util.ReadAheadInputStream.fill(ReadAheadInputStream.java:113)
com.mysql.jdbc.util.ReadAheadInputStream.readFromUnderlyingStreamIfNecessary(ReadAheadInputStream.java:160)
com.mysql.jdbc.util.ReadAheadInputStream.read(ReadAheadInputStream.java:188)
com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:1931)
com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2380)
com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2909)
com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1600)
com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1695)
com.mysql.jdbc.Connection.execSQL(Connection.java:3020)
com.mysql.jdbc.Connection.execSQL(Connection.java:2949)
com.mysql.jdbc.Statement.executeQuery(Statement.java:959)
com.mysql.jdbc.Connection.buildCollationMapping(Connection.java:1598)
com.mysql.jdbc.Connection.initializePropsFromServer(Connection.java:3773)
com.mysql.jdbc.Connection.createNewIO(Connection.java:2585)
com.mysql.jdbc.Connection.<init>(Connection.java:1485)
com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:266)
com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:134)
com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:182)
com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:171)
com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:137)
com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1014)
com.mchange.v2.resourcepool.BasicResourcePool.access$800(BasicResourcePool.java:32)
com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask.run(BasicResourcePool.java:1810)
com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:547)
Thread[com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#2,5,main]
java.net.SocketInputStream.socketRead0(Native Method)
java.net.SocketInputStream.read(SocketInputStream.java:129)
com.mysql.jdbc.util.ReadAheadInputStream.fill(ReadAheadInputStream.java:113)
com.mysql.jdbc.util.ReadAheadInputStream.readFromUnderlyingStreamIfNecessary(ReadAheadInputStream.java:160)
com.mysql.jdbc.util.ReadAheadInputStream.read(ReadAheadInputStream.java:188)
com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:1931)
com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2380)
com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2909)
com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1600)
com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1695)
com.mysql.jdbc.Connection.execSQL(Connection.java:3020)
com.mysql.jdbc.Connection.execSQL(Connection.java:2949)
com.mysql.jdbc.Statement.executeQuery(Statement.java:959)
com.mysql.jdbc.Connection.buildCollationMapping(Connection.java:1598)
com.mysql.jdbc.Connection.initializePropsFromServer(Connection.java:3773)
com.mysql.jdbc.Connection.createNewIO(Connection.java:2585)
com.mysql.jdbc.Connection.<init>(Connection.java:1485)
com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:266)
com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:134)
com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:182)
com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:171)
com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:137)
com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1014)
com.mchange.v2.resourcepool.BasicResourcePool.access$800(BasicResourcePool.java:32)
Thread[com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#0,5,main]
java.net.SocketInputStream.socketRead0(Native Method)
java.net.SocketInputStream.read(SocketInputStream.java:129)
com.mysql.jdbc.util.ReadAheadInputStream.fill(ReadAheadInputStream.java:113)
com.mysql.jdbc.util.ReadAheadInputStream.readFromUnderlyingStreamIfNecessary(ReadAheadInputStream.java:160)
com.mysql.jdbc.util.ReadAheadInputStream.read(ReadAheadInputStream.java:188)
com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:1931)
com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2380)
com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2909)
com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1600)
com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1695)
com.mysql.jdbc.Connection.execSQL(Connection.java:3020)
com.mysql.jdbc.Connection.execSQL(Connection.java:2949)
com.mysql.jdbc.Statement.executeQuery(Statement.java:959)
com.mysql.jdbc.Connection.buildCollationMapping(Connection.java:1598)
com.mysql.jdbc.Connection.initializePropsFromServer(Connection.java:3773)
com.mysql.jdbc.Connection.createNewIO(Connection.java:2585)
com.mysql.jdbc.Connection.<init>(Connection.java:1485)
com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:266)
com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:134)
com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:182)
com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:171)
com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:137)
com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1014)
com.mchange.v2.resourcepool.BasicResourcePool.access$800(BasicResourcePool.java:32)
com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask.run(BasicResourcePool.java:1810)
com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:547)
Thread[com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#1,5,main]
java.net.SocketInputStream.socketRead0(Native Method)
java.net.SocketInputStream.read(SocketInputStream.java:129)
com.mysql.jdbc.util.ReadAheadInputStream.fill(ReadAheadInputStream.java:113)
com.mysql.jdbc.util.ReadAheadInputStream.readFromUnderlyingStreamIfNecessary(ReadAheadInputStream.java:160)
com.mysql.jdbc.util.ReadAheadInputStream.read(ReadAheadInputStream.java:188)
com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:1931)
com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2380)
com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2909)
com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1600)
com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1695)
com.mysql.jdbc.Connection.execSQL(Connection.java:3020)
com.mysql.jdbc.Connection.execSQL(Connection.java:2949)
com.mysql.jdbc.Statement.executeQuery(Statement.java:959)
com.mysql.jdbc.Connection.buildCollationMapping(Connection.java:1598)
com.mysql.jdbc.Connection.initializePropsFromServer(Connection.java:3773)
com.mysql.jdbc.Connection.createNewIO(Connection.java:2585)
com.mysql.jdbc.Connection.<init>(Connection.java:1485)
com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:266)
com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:134)
com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:182)
com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:171)
com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:137)
com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1014)
com.mchange.v2.resourcepool.BasicResourcePool.access$800(BasicResourcePool.java:32)
com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask.run(BasicResourcePool.java:1810)
com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:547)


Thanks
Rohit
rohit arora
Greenhorn

Joined: Nov 21, 2008
Posts: 6
and here is hibernate.cfg.xml


<property name="connection.provider_class">
org.hibernate.connection.C3P0ConnectionProvider
</property>
<!-- configuration pool via c3p0-->
<property name="hibernate.c3p0.acquire_increment">1</property>
<property name="hibernate.c3p0.idle_test_period">100</property> <!-- seconds -->
<property name="hibernate.c3p0.max_size">100</property>
<property name="hibernate.c3p0.max_statements">0</property>
<property name="hibernate.c3p0.min_size">10</property>
<property name="hibernate.c3p0.timeout">0</property> <!-- seconds -->
<!-- Database connection settings -->
<property name="connection.driver_class">
com.mysql.jdbc.Driver
</property>


Thanks
Rohit
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10102
    
165

"rohit trojan"

Please check your private message for a message from JavaRanch.


[My Blog] [JavaRanch Journal]
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10102
    
165

A google search led me to this thread in the Hibernate forum, where one of the C3P0 Developer has provided and explanation and a solution.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: APPARENT DEADLOCK Hibernate and c3p0 error site goes down please help