Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-4814

AvaticaConnection#isValid() doesn't correspond JDBC API

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • avatica
    • None

    Description

      AvaticaConnection implements Connection interface of JDBC API, but it's isValid() method doesn't correspond java documentation.

      Currently, AvaticaConnection only checks attribute 'closed' via method isClosed() and do nothing more. With current implementation, AvaticaConnection#isValid(int timeout) totally correspond to AvaticaConnection#isClosed() what is actually incorrect, according to java documentation.

      In it's turn, AvaticaConnection#isClosed() will return 'true', only when connection will be closed directly by client and it doesn't handle case, when server closes connection or server is not accessible due to network issues and etc.

       

      AvaticaConnection#isValid should check weather connection is valid. The driver may submit a query on the connection or use some other mechanism that positively verifies the connection is still valid when this method is called.

      Here is some examples of implementations in MySql JDBC and Postgres JDBC.

       

       

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              mrymar Maksym Rymar
              Votes:
              1 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated: