mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
More for AR-460: System concurrency
There might be a few SDK projects that still use TransactionUtil, but this checkin gets rid of its use otherwise. I took a glance over the areas of the code that use UserTransaction directly and didn't see any transactionally wrapped code that desperately needed to be put into a retry loop (i.e. write transactions in a concurrent scenario). If you spot any that you think might qualify, let me know. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@6220 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -34,9 +34,7 @@ import org.alfresco.i18n.I18NUtil;
|
||||
import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.repo.importer.ImporterBootstrap;
|
||||
import org.alfresco.repo.node.index.FullIndexRecoveryComponent.RecoveryMode;
|
||||
import org.alfresco.repo.search.impl.lucene.LuceneQueryParser;
|
||||
import org.alfresco.repo.transaction.TransactionUtil;
|
||||
import org.alfresco.repo.transaction.TransactionUtil.TransactionWork;
|
||||
import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback;
|
||||
import org.alfresco.service.cmr.repository.ContentReader;
|
||||
import org.alfresco.service.cmr.repository.ContentService;
|
||||
import org.alfresco.service.cmr.repository.InvalidStoreRefException;
|
||||
@@ -173,15 +171,15 @@ public class ConfigurationChecker extends AbstractLifecycleBean
|
||||
@Override
|
||||
protected void onBootstrap(ApplicationEvent event)
|
||||
{
|
||||
TransactionWork<Object> checkWork = new TransactionWork<Object>()
|
||||
RetryingTransactionCallback<Object> checkWork = new RetryingTransactionCallback<Object>()
|
||||
{
|
||||
public Object doWork() throws Exception
|
||||
public Object execute() throws Exception
|
||||
{
|
||||
check();
|
||||
return null;
|
||||
}
|
||||
};
|
||||
TransactionUtil.executeInUserTransaction(transactionService, checkWork);
|
||||
transactionService.getRetryingTransactionHelper().doInTransaction(checkWork);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -216,6 +214,7 @@ public class ConfigurationChecker extends AbstractLifecycleBean
|
||||
// continue;
|
||||
//}
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
NodeRef rootNodeRef = null;
|
||||
try
|
||||
{
|
||||
|
@@ -33,8 +33,7 @@ import org.alfresco.error.AlfrescoRuntimeException;
|
||||
import org.alfresco.repo.node.integrity.IntegrityChecker;
|
||||
import org.alfresco.repo.security.authentication.AuthenticationComponent;
|
||||
import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
||||
import org.alfresco.repo.transaction.TransactionUtil;
|
||||
import org.alfresco.repo.transaction.TransactionUtil.TransactionWork;
|
||||
import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback;
|
||||
import org.alfresco.service.cmr.admin.PatchException;
|
||||
import org.alfresco.service.cmr.repository.NodeService;
|
||||
import org.alfresco.service.cmr.search.SearchService;
|
||||
@@ -340,9 +339,9 @@ public abstract class AbstractPatch implements Patch
|
||||
{
|
||||
public String doWork() throws Exception
|
||||
{
|
||||
TransactionWork<String> patchWork = new TransactionWork<String>()
|
||||
RetryingTransactionCallback<String> patchWork = new RetryingTransactionCallback<String>()
|
||||
{
|
||||
public String doWork() throws Exception
|
||||
public String execute() throws Exception
|
||||
{
|
||||
|
||||
// downgrade integrity checking
|
||||
@@ -353,8 +352,7 @@ public abstract class AbstractPatch implements Patch
|
||||
return report;
|
||||
}
|
||||
};
|
||||
|
||||
return TransactionUtil.executeInNonPropagatingUserTransaction(transactionService, patchWork);
|
||||
return transactionService.getRetryingTransactionHelper().doInTransaction(patchWork);
|
||||
}
|
||||
};
|
||||
String report = AuthenticationUtil.runAs(authorisedPathWork, AuthenticationUtil.getSystemUserName());
|
||||
|
Reference in New Issue
Block a user