RM-2072 (Concurrency exceptions and deadlocks on Records Management "File to" rule)

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/BRANCHES/V2.2.1.x@102241 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Tuna Aksoy
2015-04-21 13:06:53 +00:00
parent 58de73c238
commit 3efe5b4202
2 changed files with 37 additions and 19 deletions

View File

@@ -759,6 +759,7 @@
<property name="filePlanService" ref="FilePlanService" /> <property name="filePlanService" ref="FilePlanService" />
<property name="publicAction" value="true"/> <property name="publicAction" value="true"/>
<property name="allowParameterSubstitutions" value="true"/> <property name="allowParameterSubstitutions" value="true"/>
<property name="retryingTransactionHelper" ref="retryingTransactionHelper" />
</bean> </bean>
<!-- Copy To --> <!-- Copy To -->

View File

@@ -11,6 +11,7 @@ import org.alfresco.module.org_alfresco_module_rm.model.RecordsManagementModel;
import org.alfresco.repo.action.ParameterDefinitionImpl; import org.alfresco.repo.action.ParameterDefinitionImpl;
import org.alfresco.repo.security.authentication.AuthenticationUtil; import org.alfresco.repo.security.authentication.AuthenticationUtil;
import org.alfresco.repo.security.authentication.AuthenticationUtil.RunAsWork; import org.alfresco.repo.security.authentication.AuthenticationUtil.RunAsWork;
import org.alfresco.repo.transaction.RetryingTransactionHelper;
import org.alfresco.service.cmr.action.Action; import org.alfresco.service.cmr.action.Action;
import org.alfresco.service.cmr.action.ParameterDefinition; import org.alfresco.service.cmr.action.ParameterDefinition;
import org.alfresco.service.cmr.dictionary.DataTypeDefinition; import org.alfresco.service.cmr.dictionary.DataTypeDefinition;
@@ -33,6 +34,9 @@ public abstract class CopyMoveLinkFileToBaseAction extends RMActionExecuterAbstr
{ {
private static Log logger = LogFactory.getLog(CopyMoveLinkFileToBaseAction.class); private static Log logger = LogFactory.getLog(CopyMoveLinkFileToBaseAction.class);
/** Retrying transaction helper */
private RetryingTransactionHelper retryingTransactionHelper;
/** action parameters */ /** action parameters */
public static final String PARAM_DESTINATION_RECORD_FOLDER = "destinationRecordFolder"; public static final String PARAM_DESTINATION_RECORD_FOLDER = "destinationRecordFolder";
public static final String PARAM_PATH = "path"; public static final String PARAM_PATH = "path";
@@ -89,6 +93,14 @@ public abstract class CopyMoveLinkFileToBaseAction extends RMActionExecuterAbstr
this.filePlanService = filePlanService; this.filePlanService = filePlanService;
} }
/**
* @param retryingTransactionHelper retrying transaction helper
*/
public void setRetryingTransactionHelper(RetryingTransactionHelper retryingTransactionHelper)
{
this.retryingTransactionHelper = retryingTransactionHelper;
}
/** /**
* @see org.alfresco.module.org_alfresco_module_rm.action.RMActionExecuterAbstractBase#addParameterDefinitions(java.util.List) * @see org.alfresco.module.org_alfresco_module_rm.action.RMActionExecuterAbstractBase#addParameterDefinitions(java.util.List)
*/ */
@@ -361,8 +373,11 @@ public abstract class CopyMoveLinkFileToBaseAction extends RMActionExecuterAbstr
{ {
return AuthenticationUtil.runAsSystem(new RunAsWork<NodeRef>() return AuthenticationUtil.runAsSystem(new RunAsWork<NodeRef>()
{ {
@Override
public NodeRef doWork() public NodeRef doWork()
{
return retryingTransactionHelper.doInTransaction(new RetryingTransactionHelper.RetryingTransactionCallback<NodeRef>()
{
public NodeRef execute() throws Throwable
{ {
NodeRef child = null; NodeRef child = null;
if (targetisUnfiledRecords) if (targetisUnfiledRecords)
@@ -385,6 +400,8 @@ public abstract class CopyMoveLinkFileToBaseAction extends RMActionExecuterAbstr
} }
}); });
} }
});
}
/** /**
* Return the context. This will be the unfiled records container of the context if targetisUnfiledRecords is true * Return the context. This will be the unfiled records container of the context if targetisUnfiledRecords is true