tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject DO NOT REPLY [Bug 48817] Skip validation query and use JDBC API for validation
Date Tue, 04 May 2010 16:28:05 GMT

--- Comment #4 from Matt Passell <> 2010-05-04 12:28:00
EDT ---
Created an attachment (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:
------- You are receiving this mail because: -------
You are the assignee for the bug.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message