From: Ray Lee Date: Thu, 13 Mar 2014 00:42:38 +0000 (-0700) Subject: CSPACE-6333: Move repoSession.save call outside the loop, so it doesn't affect the... X-Git-Url: https://git.aero2k.de/?a=commitdiff_plain;h=a37da94f42c8d513f9aaca202a2ac470092d9b65;p=tmp%2Fjakarta-migration.git CSPACE-6333: Move repoSession.save call outside the loop, so it doesn't affect the search results each time through the loop. --- diff --git a/services/common/src/main/java/org/collectionspace/services/common/relation/RelationUtils.java b/services/common/src/main/java/org/collectionspace/services/common/relation/RelationUtils.java index 2846194d6..74e1a82f3 100644 --- a/services/common/src/main/java/org/collectionspace/services/common/relation/RelationUtils.java +++ b/services/common/src/main/java/org/collectionspace/services/common/relation/RelationUtils.java @@ -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);