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:
Derek Hulley
2007-07-12 04:15:28 +00:00
parent 32054c773c
commit 0d1bd57217
31 changed files with 230 additions and 286 deletions

View File

@@ -19,7 +19,7 @@ package org.alfresco.repo.security.person;
import java.util.Set;
import org.alfresco.model.ContentModel;
import org.alfresco.repo.transaction.TransactionUtil;
import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.repository.NodeService;
import org.alfresco.service.cmr.repository.datatype.DefaultTypeConverter;
@@ -78,11 +78,10 @@ public class SplitPersonCleanupBootstrapBean extends AbstractLifecycleBean
*/
private int removePeopleWithGUIDBasedIds()
{
Integer count = TransactionUtil.executeInUserTransaction(transactionService,
new TransactionUtil.TransactionWork<Integer>()
Integer count = transactionService.getRetryingTransactionHelper().doInTransaction(
new RetryingTransactionCallback<Integer>()
{
public Integer doWork() throws Exception
public Integer execute() throws Exception
{
int count = 0;
// A GUID should be 36 chars
@@ -121,6 +120,7 @@ public class SplitPersonCleanupBootstrapBean extends AbstractLifecycleBean
String guidString = uid.substring(uid.length() - 36);
try
{
@SuppressWarnings("unused")
UUID id = new UUID(guidString);
// We have a valid guid.
return true;
@@ -140,6 +140,7 @@ public class SplitPersonCleanupBootstrapBean extends AbstractLifecycleBean
guidString = guidString.substring(1, 37);
try
{
@SuppressWarnings("unused")
UUID id = new UUID(guidString);
// We have a valid guid.
return true;