commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Wm.A.Stafford" <>
Subject Re: DBCP - What is this thread dump telling me?
Date Mon, 15 Oct 2007 13:06:06 GMT
    Thanks for the reply.  I have my doubts about unclosed connections 
as the cause because this application ran for a year using an Oracle 
DataSource class with no problems.  We moved to DPCP in order to support 
non-oracle DBs and that is when the problem started.

    If the problem was simply running out of connections would there be 
all these threads in wait state?   getConnecton() throws an SQLException 
if it can't get a connection.  Wouldn't that case apply if there were no 
connections available?  Based on the thread dump the problem seems to be 
related to a locked object that the getConnection logic is trying to access.

Any help or advice will be greatly appreciated,

Filip Hanik - Dev Lists wrote:
> 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
> Filip
> 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:


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

View raw message