markt-asf commented on code in PR #1101:
URL: https://github.com/apache/tomcat/pull/1101#discussion_r4362201402


##########
modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java:
##########
@@ -321,13 +319,12 @@ protected Connection setupConnection(PooledConnection 
con) throws SQLException {
             }
             //cache handler for the next iteration
             con.setHandler(handler);
-        } else {
-            JdbcInterceptor next = handler;
-            //we have a cached handler, reset it
-            while (next!=null) {
-                next.reset(this, con);
-                next = next.getNext();
-            }
+        }
+        //reset the chain in the order the interceptors are declared, for new 
and cached handlers alike
+        JdbcInterceptor next = handler;
+        while (next!=null) {
+            next.reset(this, con);

Review Comment:
   You need to catch exceptions that happen here and wrap them in an 
SQLException



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to