belugabehr commented on a change in pull request #2269:
URL: https://github.com/apache/hive/pull/2269#discussion_r631882813



##########
File path: 
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/ObjectStore.java
##########
@@ -642,112 +642,140 @@ public void rollbackTransaction() {
   @Override
   public void createCatalog(Catalog cat) throws MetaException {
     LOG.debug("Creating catalog {}", cat);
-    boolean committed = false;
+
     MCatalog mCat = catToMCat(cat);
+
+    final Transaction tx = pm.currentTransaction();
+
     try {
-      openTransaction();
+      tx.begin();
       pm.makePersistent(mCat);
-      committed = commitTransaction();
+      tx.commit();
     } finally {
-      if (!committed) {
-        rollbackTransaction();
+      if (tx.isActive()) {
+        tx.rollback();
       }
     }
   }
 
   @Override
   public void alterCatalog(String catName, Catalog cat)
-      throws MetaException, InvalidOperationException {
+      throws MetaException, InvalidOperationException, NoSuchObjectException {

Review comment:
       This should also throw NoSuchObjectException if user is attempting to 
alter a non-existing catalog




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