You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by br...@apache.org on 2014/11/17 23:45:13 UTC

svn commit: r1640250 - /hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/ObjectStore.java

Author: brock
Date: Mon Nov 17 22:45:12 2014
New Revision: 1640250

URL: http://svn.apache.org/r1640250
Log:
HIVE-8891 - Another possible cause to NucleusObjectNotFoundException from drops/rollback (Chaoyu Tang via Brock)

Modified:
    hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/ObjectStore.java

Modified: hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/ObjectStore.java
URL: http://svn.apache.org/viewvc/hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/ObjectStore.java?rev=1640250&r1=1640249&r2=1640250&view=diff
==============================================================================
--- hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/ObjectStore.java (original)
+++ hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/ObjectStore.java Mon Nov 17 22:45:12 2014
@@ -466,12 +466,15 @@ public class ObjectStore implements RawS
     if (currentTransaction.isActive()
         && transactionStatus != TXN_STATUS.ROLLBACK) {
       transactionStatus = TXN_STATUS.ROLLBACK;
-      // could already be rolled back
-      currentTransaction.rollback();
-      // remove all detached objects from the cache, since the transaction is
-      // being rolled back they are no longer relevant, and this prevents them
-      // from reattaching in future transactions
-      pm.evictAll();
+      try {
+        // could already be rolled back
+        currentTransaction.rollback();
+      } finally {
+        // remove all detached objects from the cache, since the transaction is
+        // being rolled back they are no longer relevant, and this prevents them
+        // from reattaching in future transactions
+        pm.evictAll();
+      }
     }
   }