Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
None
-
None
-
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
- is caused by
-
CALCITE-1520 org.apache.calcite.avatica.AvaticaConnection: support isValid()
- Closed