commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gaurav.Go...@ercgroup.com
Subject RE: [DBCP] Exceptions in multi user environment.
Date Tue, 04 Mar 2003 01:00:51 GMT
I've been able to reproduce it a couple of times out of the 100 or so times
I tried that the pool returned the same connection handle for two different
threads.
To do this I simply clicked the same URL in our application multiple times
and printed out the thread name and the connection retured. So I saw that
the same connection was retured for two different threads in succession. The
connection returned by the first thread hadn't been closed before the same
connection was returned to another thread..


-----Original Message-----
From: Rodney Waldhoff [mailto:rwaldhoff@apache.org]
Sent: Monday, March 03, 2003 5:21 PM
To: Jakarta Commons Users List
Subject: RE: [DBCP] Exceptions in multi user environment.


On Mon, 3 Mar 2003, srinath narasimhan wrote:

> I am using DBCP and found that similar error happens if one of my thread
> crashes and does not return
> the connection to the pool. I beleive that the connection is closed, but
it
> is not removed from the pool
> for some reason. Once I fix the thread crash issue, it seems to go away.
> But I was able to reproduce the problem for certain.

The pool should see the connection as "active" in this case, and not
return it to the client code.  (Assuming the "abandonded object" stuff
isn't configured.)  Indeed, it is likely the pool doesn't even have a
reference to the object in this case, which would allow the gc process to
close the connection, but wouldn't cause it to be returned by the pool
again.

>
> The way I found is, I had debug in my object shutdowns and printed the
> thread which is executing
> the shutdown, I found that whenever Finalizer thread was executing through
> the shutdown ( which happens during crash )
> I got this error on the next database access.
>
> Hope this helps.
>

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org

Mime
View raw message