You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by bu...@apache.org on 2003/08/27 14:06:58 UTC

DO NOT REPLY [Bug 22750] New: - BasicDataSource always sets testOnBorrow if given a validation query

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);
}