https://issues.apache.org/bugzilla/show_bug.cgi?id=54978

            Bug ID: 54978
           Summary: Validate on Borrow should be tested on Reconnect
                    instead of Validate On Connect
           Product: Tomcat Modules
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: jdbc-pool
          Assignee: [email protected]
          Reporter: [email protected]
    Classification: Unclassified

If testOnBorrow is set true, testOnConnect is false, and validationQuery is an
illegal query, the current implementation will hide the fact that
validationQuery never succeeds.

The offending code is in org.apache.tomcat.jdbc.pool.ConnectionPool line 797.

790            //if we reached here, that means the connection
791                //is either has another principal, is discarded or
validation failed.
792                //we will make one more attempt
793                //in order to guarantee that the thread that just acquired
794                //the connection shouldn't have to poll again.
795                try {
796                    con.reconnect();
797                    if (con.validate(PooledConnection.VALIDATE_INIT)) {

Instead, con.validate(PooledConnection.VALIDATE_BORROW) should be called.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to