This is an automated email from the ASF dual-hosted git repository. rmaucher pushed a commit to branch 10.1.x in repository https://gitbox.apache.org/repos/asf/tomcat.git
commit ac5b02ea7bc7024e93f17cc7fcedd21c3a757114 Author: opencode <[email protected]> AuthorDate: Fri Nov 6 11:27:21 2026 +0100 Clarify Validator error handling StackOverflowError is swallowed as a non-fatal error and converted into a validation failure; only the remaining VirtualMachineError types are re-thrown. --- .../src/main/java/org/apache/tomcat/jdbc/pool/Validator.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/Validator.java b/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/Validator.java index 04f78f377f..94c77594d1 100644 --- a/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/Validator.java +++ b/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/Validator.java @@ -28,8 +28,9 @@ public interface Validator { * Validate a connection and return a boolean to indicate if it's valid. * <p> * The pool calls this method with the underlying JDBC connection, outside any interceptor chain, and treats any - * runtime exception or non-fatal {@link Error} thrown by an implementation as a validation failure; only a - * {@link VirtualMachineError} is re-thrown. Implementations that invoke JDBC APIs must catch + * runtime exception or non-fatal {@link Error} thrown by an implementation as a validation failure. A + * {@link StackOverflowError} is swallowed like a non-fatal error; the other {@link VirtualMachineError} types are + * re-thrown. Implementations that invoke JDBC APIs must catch * {@link java.sql.SQLException} and return {@code false} themselves, since this method does not declare a checked * exception. A {@code false} result (or a thrown runtime exception or error) causes the pool to discard the * connection; on a borrow that discard happens within the same {@code getConnection()} call, as the pool --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
