]> git.aero2k.de Git - tmp/jakarta-migration.git/commitdiff
CSPACE-6333: Move repoSession.save call outside the loop, so it doesn't affect the...
authorRay Lee <rhlee@berkeley.edu>
Thu, 13 Mar 2014 00:42:38 +0000 (17:42 -0700)
committerRay Lee <rhlee@berkeley.edu>
Thu, 13 Mar 2014 00:42:38 +0000 (17:42 -0700)
services/common/src/main/java/org/collectionspace/services/common/relation/RelationUtils.java

index 2846194d66001f743ffd9bb76a4fbb2aaefd9771..74e1a82f3557ecb3d06fac6e31450a1d1b6c1886 100644 (file)
@@ -116,15 +116,6 @@ public class RelationUtils {
                                 targetField, newRefName, docModel.getName()));
                     }
                 }
-                //
-                // Flush the results
-                //
-                try {
-                    repoSession.save();
-                } catch (ClientException e) {
-                    // TODO Auto-generated catch block
-                    logger.error("Could not flush results of relation-refName payload updates to Nuxeo repository");
-                }
     
                 // FIXME: Per REM, set a limit of num objects - something like
                 // 1000K objects - and also add a log Warning after some threshold
@@ -138,7 +129,17 @@ public class RelationUtils {
             logger.debug(Tools.errorToString(e, true));
             throw e;
         }
-        
+
+        //
+        // Flush the results
+        //
+        try {
+            repoSession.save();
+        } catch (ClientException e) {
+            // TODO Auto-generated catch block
+            logger.error("Could not flush results of relation-refName payload updates to Nuxeo repository");
+        }
+
         logger.debug("updateRefNamesInRelations updated " + docsUpdated + " relations document(s)"
                 + " with new refName " + newRefName
                 + " where " + targetField + " contained old refName " + oldRefName);