kgyrtkirk commented on a change in pull request #1071:
URL: https://github.com/apache/hive/pull/1071#discussion_r438601029
##########
File path:
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/ObjectStore.java
##########
@@ -13272,19 +13283,18 @@ public int deleteScheduledExecutions(int
maxRetainSecs) {
return 0;
}
boolean committed = false;
+ Query q = null;
try {
openTransaction();
int maxCreateTime = (int) (System.currentTimeMillis() / 1000) -
maxRetainSecs;
- Query q = pm.newQuery(MScheduledExecution.class);
+ q = pm.newQuery(MScheduledExecution.class);
Review comment:
The `Query` and `QueryWrapper` classes are `AutoCloseable` - which might
be better than closing it by hand (`Query#close` calls `closeAll` so it does
the same)
so I think it would be better to use try-with-resources to close these
objects...at least in cases when there is already a `try` there...
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]