commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Filip Hanik - Dev Lists <>
Subject Re: DBCP - What is this thread dump telling me?
Date Fri, 12 Oct 2007 21:01:17 GMT
looks like you are running out of connections, and on the contrary to 
what you say, you are not closing them correctly :)
what if you replace the static connection object with a new one before 
you called close on the old one


Wm.A.Stafford wrote:
> Our Tomcat instance has been hanging add odd  intervals. We see many, 
> many identical thread dumps like this:
> http-8082-Processor84" daemon prio=10 tid=0x0887c000 nid=0x5663 in 
> Object.wait() [0x6c1ad000..0x6c1ae030]
>   java.lang.Thread.State: WAITING (on object monitor)
>    at java.lang.Object.wait(Native Method)
>    - waiting on <0x75132118> (a 
> org.apache.commons.dbcp.AbandonedObjectPool)
>    at java.lang.Object.wait(
>    at 
> org.apache.commons.pool.impl.GenericObjectPool.borrowObject(Unknown 
> Source)
>    - locked <0x75132118> (a org.apache.commons.dbcp.AbandonedObjectPool)
>    at 
> org.apache.commons.dbcp.AbandonedObjectPool.borrowObject(

>    - locked <0x75132118> (a org.apache.commons.dbcp.AbandonedObjectPool)
>    at 
> org.apache.commons.dbcp.PoolingDataSource.getConnection( 
>    at 
> org.apache.commons.dbcp.BasicDataSource.getConnection( 
>    at 
> dbAccess.FailSafeConnectionPool.getConnection( 
>    at servlets.ControllerServlet.doGet(
> There is clearly something pathological going on but I'm not sure 
> what.  It looks to me like this and all the other threads are waiting 
> on org.apache.commons.dbcp.AbandonedObjectPool which is locked by 
> another thread.  But I can not deduce much more.
> We are using dbcp-1.0.  The code handles connections rather strangely 
> but it seems to be closing them correctly.  There is one static 
> Connection object and a call to a local getConnection() calls close() 
> on this static connection then replaces it with a connection returned 
> by a call to BasicDataSource.getConnection().
> There is one exception handler that calls close() on the 
> BasicDataSource and then creates a new one. I thought this might be 
> the problem, that somehow the connections associated with the previous 
> BasicDataSource were still being held but I can't see a scenario that 
> would do this.
> We are also using a BasicDataSource in our Spring enabled DAOs but 
> there is no common code sheared by these and the legacy code that is 
> being fingered by the thread dump.
> Any help or advice will be greatly appreciated,
> -=beeky
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message