commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vjeran Marcinko" <vje...@tis.hr>
Subject [dbpc-1.2.1 or pool-1.2] bug with invalid DB connection
Date Sat, 24 Jul 2004 08:31:57 GMT
Hi folks.

I'm using GenericKeyedObjectPool and KeyedCPDSConnectionFactory.

As I see, pool should return db connection from borrowObject() method when
it has been validated by validationQuery.
But current situation is that when some connection proved to be *invalid* by
this validation query, pool is trying to close this connection, and that
raises IOException since this connection is invalid in first place, and pool
doesn't ignore this exception but propagates it, instead to continue looping
and searching for valid one (or creating new one).

Thus, it should be
if(_testOnBorrow && !_factory.validateObject(key,pair.value)) {
    try {
    _factory.destroyObject(key,pair.value);
    } catch (Exception ex) {
    // ignore
    }

inside borrowObject() in GenericKeyedObjectPool.
Or this exception ca also be ignored in KeyedCPDSConnectionFactory's
destroyObject()

Am I right ?

regards,
Vjeran


*****************
Tis.kis d.o.o
Heinzelova 33
10000 Zagreb, CROATIA
URL: http://www.tiskis.com
Phone: +385 91 2392624


---------------------------------------------------------------------
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