From a38206915f1a2167b09dab1bf58f56d1b49eb978 Mon Sep 17 00:00:00 2001 From: Roy Wetherall Date: Wed, 9 May 2007 13:22:50 +0000 Subject: [PATCH] - Preformance improvement to Auditable Aspect suggested by community - PHP library refactoring - Associated changes to tests and examples git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@5646 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .../alfresco/repo/audit/AuditableAspect.java | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/source/java/org/alfresco/repo/audit/AuditableAspect.java b/source/java/org/alfresco/repo/audit/AuditableAspect.java index c9184b1a6a..c5a7adf422 100644 --- a/source/java/org/alfresco/repo/audit/AuditableAspect.java +++ b/source/java/org/alfresco/repo/audit/AuditableAspect.java @@ -258,12 +258,17 @@ public class AuditableAspect */ public Boolean doWork() throws Exception { - for (QName propertyQName : properties.keySet()) - { - Serializable property = properties.get(propertyQName); - nodeService.setProperty(nodeRef, propertyQName, property); - } - return Boolean.TRUE; + // Set all the properties in one nodeService call to avoid multiple calls to onUpdateProperties + Map allProps = nodeService.getProperties(nodeRef); + + for (QName propertyQName : properties.keySet()) + { + Serializable property = properties.get(propertyQName); + allProps.put(propertyQName, property); + } + nodeService.setProperties(nodeRef, allProps); + return Boolean.TRUE; + } }