commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rodney Waldhoff <>
Subject RE: [DBCP] Connections Die
Date Fri, 07 Mar 2003 19:41:21 GMT
On Fri, 7 Mar 2003, Tauzell, Dave wrote:

> Weblogic's JDBC pool has two options:
> 1. Validate on checkout
> 2. Validation on return
> You can select any or none of the options.  If you don't select any and
> the pooled connections go bad, then you'll get bad connections when
> checking out. I personally like validating the connection on checkout,
> although your code is then tied to a pool that does this.
> -Dave

Right, and DBCP does those two options, plus a third: validation while
idle, the periodically walks through the connections sitting idle in the
pool and evicts the ones that go bad.

Personally, I use the third option almost exclusively, attempting to
strike some balance between the validation overhead and the time it will
take the app to recover (i.e., purge the bad connections and establish new

It's really the same problem with or without pooling, sometimes your
connection will go bad.  Validation or failure detection can't prevent
this problem, it can only try to minimize it.  (For example, assume you've
got this magical "detect a dropped connection and quietly substitute a
valid one, at any point in the client code" facility.  It's still possible
for a connection to be dropped in the midst of a client transaction, and
there may be little the connection wrapper can do to make that problem
quietly go away.  Record and replay the executed statements?  How do you
know whether the exception-throwing statement made it to the database or

View raw message