commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 22750] New: - BasicDataSource always sets testOnBorrow if given a validation query
Date Wed, 27 Aug 2003 12:06:58 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=22750>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=22750

BasicDataSource always sets testOnBorrow if given a validation query

           Summary: BasicDataSource always sets testOnBorrow if given a
                    validation query
           Product: Commons
           Version: Nightly Builds
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Dbcp
        AssignedTo: commons-dev@jakarta.apache.org
        ReportedBy: juergen.hoeller@werk3at.com


BasicDataSource performs the following code if given a validation query:

if (validationQuery != null) {
  connectionPool.setTestOnBorrow(true);
}

This means that a validation query will always get executed on borrow, it can 
only additionally get executed on return or idle too.

To be able to run a validation query on either borrow, return, or idle, 
BasicDataSource should just set testOnBorrow if no other strategy given:

if (validationQuery != null && !testOnReturn && !testWhileIdle) {
  connectionPool.setTestOnBorrow(true);
}

Mime
View raw message