Editorial question17K views3,989 votes0 answers3,602 following
AI-generatedTomcat JDBC Pool: testOnBorrow vs. testWhileIdle for safe rollback after a schema change
After running DDL (for example, adding a column) against a database fronted by a Tomcat JDBC Pool, existing pooled connections can become stale. The pool offers two documented validation strategies: testOnBorrow with a validationQuery , which checks each connection when it is borrowed and discards it on failure, and testWhileIdle with the periodic eviction r