You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In your (very good) article Bad Behavior: Handling Database Down you observe the following about Tomcat's validate-on-checkout behaviour: "Tomcat returns a connection seemingly ignoring setTestOnBorrow(true) as the validation query could not possibly succeed."
I experienced the same issue and found that there is a second config setting affecting the behaviour of setTestOnBorrow(true), namely setValidationInterval(milliseconds) that will effectively limit how often the testOnBorrow will be executed. The default is 30 seconds. After setting this to a 1000 ms (or lower) the validation query did run and it didn't give me bad connections anymore (in my own test).
Thank you for the update. I'm on business travel for the next two weeks, and away from my test environment, but I will re-run the tests when I get back. There is also an open issue from the author(s) of the Vibur pool to update the test based on changes they have made.
Hi!
In your (very good) article Bad Behavior: Handling Database Down you observe the following about Tomcat's validate-on-checkout behaviour: "Tomcat returns a connection seemingly ignoring setTestOnBorrow(true) as the validation query could not possibly succeed."
I experienced the same issue and found that there is a second config setting affecting the behaviour of
setTestOnBorrow(true)
, namelysetValidationInterval(milliseconds)
that will effectively limit how often the testOnBorrow will be executed. The default is 30 seconds. After setting this to a 1000 ms (or lower) the validation query did run and it didn't give me bad connections anymore (in my own test).Please see the documentation for both
testOnBorrow
andvalidationInterval
here: https://tomcat.apache.org/tomcat-8.0-doc/jdbc-pool.htmlI'm guessing this might result in a slightly better grade for the Tomcat pool :)
The text was updated successfully, but these errors were encountered: