zhangbutao commented on code in PR #3388:
URL: https://github.com/apache/hive/pull/3388#discussion_r959285058
##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/dataconnector/jdbc/AbstractJDBCConnectorProvider.java:
##########
@@ -129,8 +129,20 @@ protected Connection getConnection() {
throw new RuntimeException("unexpected type for connection handle");
}
+ protected boolean isOpen() {
+ if (handle == null) {
+ return false;
+ }
+ try {
+ return ((Connection)handle).isClosed();
Review Comment:
> also isValid() might be better than isClosed(). I dont know if isClosed()
returns true if close() has not been called on the connection. isValid() seems
to test the health of the connection
I agree :)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]