We're updating the issue view to help you get more done. 

IndexOutOfBounds exception thrown by java.sql.Connection.isValid()

Description

I have a daemon that keeps a SQL connection open. It periodically checks the status of the connection using java.sql.Connection.isValid.

I've been running this for months. Today I saw the method throw exception java.lang.IndexOutOfBoundsException. I dealt with it like I would an SQLException, but it suggests that there is a bug in the JDBC driver.

Here's the method:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 public boolean connectionIsValid() { final int maxSecondsToWait = 2; boolean isValid; if (_conn == null) { isValid = false; } else { try { isValid = _conn.isValid(maxSecondsToWait); } catch (Throwable ex) { isValid = false; _logger.error(String.format("AuditorDB.connectionIsValid error: %s", ex.toString())); } } return isValid; }

Environment

32-bigt CentOS 6.5

Status

Assignee

Massimo Siani

Reporter

Bob Stine

Labels

None

External issue ID

None

External issue ID

None

Fix versions

Priority

Minor