From a37da94f42c8d513f9aaca202a2ac470092d9b65 Mon Sep 17 00:00:00 2001 From: Ray Lee Date: Wed, 12 Mar 2014 17:42:38 -0700 Subject: [PATCH] CSPACE-6333: Move repoSession.save call outside the loop, so it doesn't affect the search results each time through the loop. --- .../common/relation/RelationUtils.java | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) 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); -- 2.47.3