Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tomcat pool performance in DbDownTest.java #3

Open
froden opened this issue Jun 1, 2015 · 1 comment
Open

Tomcat pool performance in DbDownTest.java #3

froden opened this issue Jun 1, 2015 · 1 comment
Labels

Comments

@froden
Copy link

froden commented Jun 1, 2015

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), 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).

Please see the documentation for both testOnBorrow and validationInterval here: https://tomcat.apache.org/tomcat-8.0-doc/jdbc-pool.html

I'm guessing this might result in a slightly better grade for the Tomcat pool :)

@brettwooldridge
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants