zhangbutao commented on code in PR #3595:
URL: https://github.com/apache/hive/pull/3595#discussion_r992277622
##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/dataconnector/jdbc/AbstractJDBCConnectorProvider.java:
##########
@@ -129,8 +129,21 @@ protected Connection getConnection() {
throw new RuntimeException("unexpected type for connection handle");
}
+ protected boolean isOpen() {
+ if (handle == null) {
+ return false;
+ }
+ try {
+ if (handle instanceof Connection)
+ return ((Connection) handle).isValid(3);
+ } catch (SQLException e) {
+ LOG.warn("Could not validate jdbc connection to "+ jdbcUrl, e);
+ }
+ return false;
+ }
+
@Override public void close() {
- if (isOpen) {
+ if (isOpen()) {
Review Comment:
Make sense. Renamed it to `isClosed()`.
--
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]