commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bryan Field-Elliot <bryan_li...@netmeme.org>
Subject Re: DBCP validation query: how to use?
Date Sun, 09 Jun 2002 17:24:01 GMT
That's the missing link, thank you! On my GenericObjectPool I have to
call setTestOnBorrow(true) right after creating it.

I assumed (obviously incorrectly) that if my PoolableConnectionFactory
had a validationQuery, then it would complete the plumbing in the other
parts of the system as necessary to make it work. But evidently not.
This was tricky and should be documented better.

Thank you!

Bryan

On Sun, 2002-06-09 at 08:12, Juozas Baliuka wrote:

    It is code in GenericObjectPool. "_testOnBorrow"  must be set to true.
    Sorry, but I dont know how to set it in DBCP, I believe somebody more
    competent will respond to your message.
    ..........................
    if( _testOnBorrow && !_factory.validateObject(pair.value)) {
                    try {
                        _factory.passivateObject(pair.value);
                    } catch(Exception e) {
                        ; // ignored, we're throwing it out anyway
                    }
                    _factory.destroyObject(pair.value);
                } else {
    .............................................



Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message