https://bz.apache.org/bugzilla/show_bug.cgi?id=60194

            Bug ID: 60194
           Summary: Support for isValid, needs clarification
           Product: Tomcat Modules
           Version: unspecified
          Hardware: PC
            Status: NEW
          Severity: normal
          Priority: P2
         Component: jdbc-pool
          Assignee: dev@tomcat.apache.org
          Reporter: peterhansson...@yahoo.com

It is now 2016 and most people are using Java 7 or Java 8. In Java 6 the
Connection.isValid() method was introduced as a way to "ping" a connection.
Yet, for anyone wishing to implement Tomcat JDBC Pool it will appear to them as
if they'll need to figure out and configure a validation query for each type of
database that they'll be using. And I guess this is true. tomcat-jdbc doesn't
take advantage of Connection.isValid(). The documentation doesn't mention
anything about Connection.isValid() as an alternative to custom validation
queries.

Other JDBC Pools takes the approach of using Connection.isValid() if present
and otherwise falling back to custom query. 

While bug 48817 discusses this issue back in 2010, I cannot really see what
came out it. 

I believe there are a number of things that can be done (in order of effort):

1. Improve documentation. What are people supposed to do?  Is the recommended
approach to implement a custom Validator which would then call
Connection.isValid()?  

2. Perhaps include a ready-made Validator which does just that. Then people can
use it simply by adding config ("show them the path").

3. Maybe time to ditch Java 5 compatibility ?  .. meaning do what other JDBC
Pools do and let Connection.isValid() be the default.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to