commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dirk Verbeeck <>
Subject Re: [DBCP] getNumActive() returns a negative value
Date Mon, 08 Sep 2003 20:20:12 GMT
I can't reproduce the negative numActive.
A testcase would be helpfull.

Anyway, can you do a test using the following pool:

I added some debugging (replace with your favorite logging impl if you 
This way we can see the offending code path.


Aitor Imaz wrote:

>I'm still getting random ObjectIsClosedExceptions once in a while using
>the nightly build (31/8), although not very often. If I'm not wrong this
>nightly build uses the wrapper that checks for double-closing
>connections, so I can't understand why I'm still getting a negative
>value when I call getNumActive(). Shouldn't the patch deal with this
>I'm doing what the Tomcat example says, except that inside the catch
>block I am closing the resultset and statement and doing a rollback on
>the transaction (and setting the connection to null). I wonder if this
>has something to do with the negative numActive value. Should I rely on
>the finally block instead?
>I see your point on returning an SQLException indicating something is
>wrong, but the problem is I'm logging the exceptions and my log file
>grows considerably as I'm getting lots of "Already closed"
>SQLExceptions. I guess this is more of an issue with the way I save the
>thrown exceptions, though.
>I'm afraid we haven't thoroughly load-tested our application (and
>therefore DBCP). I am using a load test simply to simulate the race
>condition and make the app fail.

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

View raw message