deniskuzZ commented on code in PR #5780:
URL: https://github.com/apache/hive/pull/5780#discussion_r2079684168


##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/ObjectStore.java:
##########
@@ -629,13 +622,13 @@ public boolean commitTransaction() {
       LOG.error("Unbalanced calls to open/commit Transaction", e);
       throw e;
     }
-    openTrasactionCalls--;
-    debugLog("Commit transaction: count = " + openTrasactionCalls + ", 
isactive "+ currentTransaction.isActive());
 
-    if ((openTrasactionCalls == 0) && currentTransaction.isActive()) {
+    debugLog("Commit transaction: count = " + openTrasactionCalls + ", 
isactive "+ currentTransaction.isActive());
+    if ((openTrasactionCalls == 1) && currentTransaction.isActive()) {
       transactionStatus = TXN_STATUS.COMMITED;
       currentTransaction.commit();
     }
+    openTrasactionCalls--;

Review Comment:
   what if commit throws RuntimeException, db txn would be closed, but 
openTrasactionCalls won't be 0



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

Reply via email to