Merged 5.0.N (5.0.4) to 5.1.N (5.1.1)

118652 cturlica: Merged V4.2-BUG-FIX (4.2.6) to 5.0.N (5.0.4)
      118603 amukha: Merged V4.2.3 (4.2.3.21) to V4.2-BUG-FIX (4.2.6)
         117952 adragoi: MNT-15169 : Receiving error when bulk deleting content in Share
            - moved deletion in a retrying context 


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.1.N/root@118714 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Andrei Rebegea
2015-11-27 09:12:13 +00:00
parent 894f14cac3
commit c6ad312dea

View File

@@ -63,6 +63,7 @@ import org.alfresco.repo.thumbnail.ThumbnailHelper;
import org.alfresco.repo.thumbnail.ThumbnailRegistry;
import org.alfresco.repo.thumbnail.script.ScriptThumbnail;
import org.alfresco.repo.transaction.AlfrescoTransactionSupport;
import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback;
import org.alfresco.repo.version.VersionModel;
import org.alfresco.repo.workflow.jscript.JscriptWorkflowInstance;
import org.alfresco.scripts.ScriptException;
@@ -2012,7 +2013,16 @@ public class ScriptNode implements Scopeable, NamespacePrefixResolverProvider
if (nodeService.exists(this.nodeRef))
{
this.nodeService.deleteNode(this.nodeRef);
RetryingTransactionCallback<Void> deleteNode = new RetryingTransactionCallback<Void>()
{
@Override
public Void execute() throws Throwable
{
nodeService.deleteNode(nodeRef);
return null;
}
};
services.getTransactionService().getRetryingTransactionHelper().doInTransaction(deleteNode, false, true);
success = true;
}