manifoldcf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1536967 - /manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/authority/AuthorityConnectionManager.java
Date Wed, 30 Oct 2013 05:40:21 GMT
Author: kwright
Date: Wed Oct 30 05:40:20 2013
New Revision: 1536967

URL: http://svn.apache.org/r1536967
Log:
Better way to handle upgrade exceptions

Modified:
    manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/authority/AuthorityConnectionManager.java

Modified: manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/authority/AuthorityConnectionManager.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/authority/AuthorityConnectionManager.java?rev=1536967&r1=1536966&r2=1536967&view=diff
==============================================================================
--- manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/authority/AuthorityConnectionManager.java
(original)
+++ manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/authority/AuthorityConnectionManager.java
Wed Oct 30 05:40:20 2013
@@ -131,6 +131,7 @@ public class AuthorityConnectionManager 
           addMap.put(groupNameField,new ColumnDescription("VARCHAR(32)",false,true,
             authMgr.getTableName(),authMgr.getGroupNameColumn(),false));
           performAlter(addMap,null,null,null);
+          boolean revert = true;
           try
           {
             ArrayList params = new ArrayList();
@@ -163,14 +164,17 @@ public class AuthorityConnectionManager 
             modifyMap.put(groupNameField,new ColumnDescription("VARCHAR(32)",false,false,
               authMgr.getTableName(),authMgr.getGroupNameColumn(),false));
             performAlter(null,modifyMap,null,null);
+            revert = false;
           }
-          catch (ManifoldCFException e)
+          finally
           {
-            // Upgrade failed; back out our changes
-            List<String> deleteList = new ArrayList<String>();
-            deleteList.add(groupNameField);
-            performAlter(null,null,deleteList,null);
-            throw e;
+            if (revert)
+            {
+              // Upgrade failed; back out our changes
+              List<String> deleteList = new ArrayList<String>();
+              deleteList.add(groupNameField);
+              performAlter(null,null,deleteList,null);
+            }
           }
         }
       }



Mime
View raw message