Uploaded image for project: 'MariaDB Connector/J'
  1. MariaDB Connector/J
  2. CONJ-91

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

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Fixed
    • None
    • 1.1.8
    • None
    • None
    • 32-bigt CentOS 6.5

    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:

          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;
          }

      Attachments

        Activity

          People

            massimo.siani Massimo Siani (Inactive)
            rstinejr Bob Stine
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.