tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 48817] Skip validation query and use JDBC API for validation
Date Tue, 04 May 2010 16:28:05 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=48817

--- Comment #4 from Matt Passell <mpassell@grovehillsoftware.com> 2010-05-04 12:28:00
EDT ---
Created an attachment (id=25398)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=25398)
If no validation query is available, fall back on other approaches

This isn't exactly what was discussed, but it's an alternative solution.  I
added logic so that PooledConnection.validate() falls back on other validation
approaches when a query isn't available.  It first calls Connection.isClosed().
 The Javadoc for that method suggests that it isn't useful for validation, but
my client managed to create a situation where he had closed connections in the
pool.  Next, it uses Java reflection to look for the Connection.isValid()
method and calls it if it exists.  If it's not available or doesn't work (the
JDBC/ODBC bridge doesn't support isValid(), for example), it falls back on
calling Connection.getMetaData(), which should in theory exercise the
connection.  If it doesn't, we could always go further and actually call a
method on the returned DatabaseMetaData.  Let me know what you think.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- 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


Mime
View raw message