diff --git a/source/java/org/alfresco/repo/site/SiteServiceImpl.java b/source/java/org/alfresco/repo/site/SiteServiceImpl.java index 215e5532ca..4817463a85 100644 --- a/source/java/org/alfresco/repo/site/SiteServiceImpl.java +++ b/source/java/org/alfresco/repo/site/SiteServiceImpl.java @@ -2860,26 +2860,31 @@ public class SiteServiceImpl extends AbstractLifecycleBean implements SiteServic final NodeRef container = containerTmp; // Ensure the calendar container has the tag scope aspect applied to it - if(! taggingService.isTagScope(container)) + if (!taggingService.isTagScope(container)) { if(logger.isDebugEnabled()) { logger.debug("Attaching tag scope to " + componentName + " " + container.toString() + " for " + siteShortName); } - AuthenticationUtil.runAs(new AuthenticationUtil.RunAsWork() { - public Void doWork() throws Exception - { - transactionService.getRetryingTransactionHelper().doInTransaction( - new RetryingTransactionCallback() { - public Void execute() throws Throwable { - // Add the tag scope aspect - taggingService.addTagScope(container); - return null; - } - }, false, true + AuthenticationUtil.runAs(new AuthenticationUtil.RunAsWork() + { + public Void doWork() throws Exception + { + RetryingTransactionHelper txnHelper = transactionService.getRetryingTransactionHelper(); + txnHelper.setForceWritable(true); + txnHelper.doInTransaction( + new RetryingTransactionCallback() + { + public Void execute() throws Throwable + { + // Add the tag scope aspect + taggingService.addTagScope(container); + return null; + } + }, false, true ); return null; - } + } }, AuthenticationUtil.getSystemUserName()); }