You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2016/10/02 14:56:56 UTC

[Bug 60194] New: Support for isValid, needs clarification

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_se@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-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 60194] Support for isValid, needs clarification

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=60194

Keiichi Fujino <kf...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #1 from Keiichi Fujino <kf...@apache.org> ---
Thanks for the report.
If validationQuery is not specified, connection validation is done by calling
the isValid() method.
The fix will be in :
- 9.0.x for 9.0.0.M14 onwards
- 8.5.x for 8.5.9 onwards
- 8.0.x for 8.0.40 onwards
- 7.0.x for 7.0.74 onwards

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org