javeme commented on code in PR #2014:
URL:
https://github.com/apache/incubator-hugegraph/pull/2014#discussion_r1019019884
##########
hugegraph-cassandra/src/main/java/com/baidu/hugegraph/backend/store/cassandra/CassandraTable.java:
##########
@@ -156,6 +156,12 @@ protected <R> Iterator<R> query(Query query,
} catch (DriverException e) {
LOG.debug("Failed to query [{}], detail statement: {}",
query, selects, e);
+ // Closing the iterator
+ try {
+ rs.close();
+ } catch (Exception closeException) {
+ throw new BackendException("Error closing Iterator during
query [%s]", e, query);
Review Comment:
I think it's better to just log.error closeException here and let throw the
DriverException at line 165, because closeException is not the main path.
##########
hugegraph-cassandra/src/main/java/com/baidu/hugegraph/backend/store/cassandra/CassandraTable.java:
##########
@@ -156,6 +156,12 @@ protected <R> Iterator<R> query(Query query,
} catch (DriverException e) {
LOG.debug("Failed to query [{}], detail statement: {}",
query, selects, e);
+ // Closing the iterator
+ try {
+ rs.close();
+ } catch (Exception closeException) {
Review Comment:
'e2' name is ok
##########
hugegraph-mysql/src/main/java/com/baidu/hugegraph/backend/store/mysql/MysqlTable.java:
##########
@@ -477,6 +477,12 @@ protected <R> Iterator<R> query(Session session, Query
query,
rs.extend(parser.apply(query, results));
}
} catch (SQLException e) {
+ // closing iterator
+ try {
+ rs.close();
+ } catch (Exception closeException) {
+ throw new BackendException("Error closing Iterator during
query [%s]", e, query);
Review Comment:
ditto
--
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]