dengzhhu653 commented on a change in pull request #1071:
URL: https://github.com/apache/hive/pull/1071#discussion_r439107695



##########
File path: 
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/ObjectStore.java
##########
@@ -13272,15 +13280,16 @@ public int deleteScheduledExecutions(int 
maxRetainSecs) {
       return 0;
     }
     boolean committed = false;
-    try {
+    try (Query q = pm.newQuery(MScheduledExecution.class)) {
       openTransaction();
       int maxCreateTime = (int) (System.currentTimeMillis() / 1000) - 
maxRetainSecs;
-      Query q = pm.newQuery(MScheduledExecution.class);
       q.setFilter("startTime <= maxCreateTime");
       q.declareParameters("int maxCreateTime");
       long deleted = q.deletePersistentAll(maxCreateTime);
       committed = commitTransaction();
       return (int) deleted;
+    } catch (Exception e) {

Review comment:
       ```try (Query q = pm.newQuery(MScheduledExecution.class)) {``` throws a 
checked exception that can't be ignored.




----------------------------------------------------------------
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]

Reply via email to