From 39cd44864aefddf5c528c8f987b653bc03943a34 Mon Sep 17 00:00:00 2001 From: Roy Wetherall Date: Fri, 18 Oct 2013 04:18:51 +0000 Subject: [PATCH] RM: Fix build * double check existance of node ref prior to work git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/BRANCHES/V2.0@56793 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .../job/PublishUpdatesJobExecuter.java | 66 ++++++++++--------- 1 file changed, 35 insertions(+), 31 deletions(-) diff --git a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/job/PublishUpdatesJobExecuter.java b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/job/PublishUpdatesJobExecuter.java index b40c648659..672f8d32ce 100644 --- a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/job/PublishUpdatesJobExecuter.java +++ b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/job/PublishUpdatesJobExecuter.java @@ -97,37 +97,41 @@ public class PublishUpdatesJobExecuter extends RecordsManagementJobExecuter // Deal with each updated disposition action in turn for (NodeRef nodeRef : nodeRefs) { - // Mark the update node as publishing in progress - markPublishInProgress(nodeRef); - try - { - Date start = new Date(); - if (logger.isDebugEnabled() == true) - { - logger.debug("Starting publish of updates ..."); - logger.debug(" - for " + nodeRef.toString()); - logger.debug(" - at " + start.toString()); - } - - // Publish updates - publishUpdates(nodeRef); - - - if (logger.isDebugEnabled() == true) - { - Date end = new Date(); - long duration = end.getTime() - start.getTime(); - logger.debug("Completed publish of updates ..."); - logger.debug(" - for " + nodeRef.toString()); - logger.debug(" - at " + end.toString()); - logger.debug(" - duration " + Long.toString(duration)); - } - } - finally - { - // Ensure the update node has either completed the publish or is marked as no longer in progress - unmarkPublishInProgress(nodeRef); - } + // double check that the node in question still exists + if (nodeService.exists(nodeRef) == true) + { + // Mark the update node as publishing in progress + markPublishInProgress(nodeRef); + try + { + Date start = new Date(); + if (logger.isDebugEnabled() == true) + { + logger.debug("Starting publish of updates ..."); + logger.debug(" - for " + nodeRef.toString()); + logger.debug(" - at " + start.toString()); + } + + // Publish updates + publishUpdates(nodeRef); + + + if (logger.isDebugEnabled() == true) + { + Date end = new Date(); + long duration = end.getTime() - start.getTime(); + logger.debug("Completed publish of updates ..."); + logger.debug(" - for " + nodeRef.toString()); + logger.debug(" - at " + end.toString()); + logger.debug(" - duration " + Long.toString(duration)); + } + } + finally + { + // Ensure the update node has either completed the publish or is marked as no longer in progress + unmarkPublishInProgress(nodeRef); + } + } } return null; };