-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: Apparent Deadlock with c3p0 causing application to hang
PostPosted: Mon Mar 26, 2007 5:46 am 
Newbie

Joined: Mon Mar 26, 2007 5:33 am
Posts: 1
Hi there,

I am running my app on Jetty 5.1.4, with Hibernate 2.1.8 and c3p0 0.9.1-pre12. I am intermittently seeing my application hanging. A scroll through the logs turns up the following:

com.mchange.v2.async.ThreadPoolAsynchronousRunner$DeadlockDetector@167c26f -- APPARENT DEADLOCK!!! Creating emergency threads for unassigned pending tasks!

and sometimes, also:
com.mchange.v2.async.ThreadPoolAsynchronousRunner$DeadlockDetector@167c26f -- APPARENT DEADLOCK!!! Complete Status:
Managed Threads: 3
Active Threads: 3
Active Tasks:
com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@151c72f (com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#2)
com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@1ec0c79 (com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#0)
com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@26dfff (com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#1)
Pending Tasks:
com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@3bebc2
com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@1f34618
com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@7ee20b
Pool thread stack traces:
Thread[com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#2,5,main]
com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1026)
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]
com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1026)
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]
com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1026)
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)

I am at a lost as to what can be going wrong. What would typically be the cause of this?

I have browsed through some other posts on this issue (e.g. http://forum.hibernate.org/viewtopic.ph ... dlock+c3p0), but still have no luck.

Any help is much appreciated!

Thanks.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 27, 2007 4:45 am 
C3P0 Developer
C3P0 Developer

Joined: Tue Jan 06, 2004 8:58 pm
Posts: 145
Hi,

For some reason, c3p0's attempts to acquire a database Connection are neither succeeding nor failing with an Exception, but are instead hanging. Your first order of debugging should be to try to figure out why that might be. Does this occur after some unusual condition, a network outage or DB restart? Why is your JDBC driver hanging rather than failing?

If you want a workaround, try the c3p0 config parameter maxAdministrativeTaskTime. This will cause c3p0 to try to interrupt threads that seem to hang during Connection acquisitions, destructions, or asynchronous Connection tests rather than waiting indefinitely for those threads to either succeed or fail with an Exception. See c3p0's docs for more.

Good luck!

Steve


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 27, 2007 10:18 am 
Newbie

Joined: Tue Mar 27, 2007 10:09 am
Posts: 2
I'm a bit of a newbie, really, but I see errors like this when I forget to start up my DB server (HSQLDB) before launching my hibernate application.

What DB server are you using? Are you sure it's running and accepting connections when these errors are generated?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.