From 0d8df7192124d4e71a4a5b2dd3ce7e2d6ab59ac7 Mon Sep 17 00:00:00 2001 From: Derek Hulley Date: Thu, 12 Jul 2007 04:15:28 +0000 Subject: [PATCH] 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 --- .../AccessControlWebService.java | 66 +++++++------- .../webservice/action/ActionWebService.java | 87 +++++++++++-------- .../AdministrationWebService.java | 52 ++++++----- .../authoring/AuthoringWebService.java | 79 ++++++++--------- .../ClassificationWebService.java | 37 ++++---- 5 files changed, 165 insertions(+), 156 deletions(-) diff --git a/source/java/org/alfresco/repo/webservice/accesscontrol/AccessControlWebService.java b/source/java/org/alfresco/repo/webservice/accesscontrol/AccessControlWebService.java index afcc631f1e..cd5b006531 100644 --- a/source/java/org/alfresco/repo/webservice/accesscontrol/AccessControlWebService.java +++ b/source/java/org/alfresco/repo/webservice/accesscontrol/AccessControlWebService.java @@ -6,8 +6,7 @@ import java.util.List; import java.util.Set; import org.alfresco.repo.transaction.TransactionServiceImpl; -import org.alfresco.repo.transaction.TransactionUtil; -import org.alfresco.repo.transaction.TransactionUtil.TransactionWork; +import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback; import org.alfresco.repo.webservice.AbstractWebService; import org.alfresco.repo.webservice.Utils; import org.alfresco.repo.webservice.action.ActionFault; @@ -72,13 +71,14 @@ public class AccessControlWebService extends AbstractWebService implements Acces { try { - return TransactionUtil.executeInUserTransaction(this.transactionService, new TransactionWork() + RetryingTransactionCallback callback = new RetryingTransactionCallback() { - public ACL[] doWork() throws Exception + public ACL[] execute() throws Exception { return getACLsImpl(predicate, filter); } - }); + }; + return transactionService.getRetryingTransactionHelper().doInTransaction(callback); } catch (Throwable exception) { @@ -167,13 +167,14 @@ public class AccessControlWebService extends AbstractWebService implements Acces { try { - return TransactionUtil.executeInUserTransaction(this.transactionService, new TransactionWork() + RetryingTransactionCallback callback = new RetryingTransactionCallback() { - public ACL[] doWork() throws Exception + public ACL[] execute() throws Exception { return addACEsImpl(predicate, aces); } - }); + }; + return transactionService.getRetryingTransactionHelper().doInTransaction(callback); } catch (Throwable exception) { @@ -229,13 +230,14 @@ public class AccessControlWebService extends AbstractWebService implements Acces { try { - return TransactionUtil.executeInUserTransaction(this.transactionService, new TransactionWork() + RetryingTransactionCallback callback = new RetryingTransactionCallback() { - public ACL[] doWork() throws Exception + public ACL[] execute() throws Exception { return removeACEsImpl(predicate, aces); } - }); + }; + return transactionService.getRetryingTransactionHelper().doInTransaction(callback); } catch (Throwable exception) { @@ -293,13 +295,14 @@ public class AccessControlWebService extends AbstractWebService implements Acces { try { - return TransactionUtil.executeInUserTransaction(this.transactionService, new TransactionWork() + RetryingTransactionCallback callback = new RetryingTransactionCallback() { - public GetPermissionsResult[] doWork() throws Exception + public GetPermissionsResult[] execute() throws Exception { return getPermissionsImpl(predicate); } - }); + }; + return transactionService.getRetryingTransactionHelper().doInTransaction(callback); } catch (Throwable exception) { @@ -350,13 +353,14 @@ public class AccessControlWebService extends AbstractWebService implements Acces { try { - return TransactionUtil.executeInUserTransaction(this.transactionService, new TransactionWork() + RetryingTransactionCallback callback = new RetryingTransactionCallback() { - public GetClassPermissionsResult[] doWork() throws Exception + public GetClassPermissionsResult[] execute() throws Exception { return getClassPermissionsImpl(classNames); } - }); + }; + return transactionService.getRetryingTransactionHelper().doInTransaction(callback); } catch (Throwable exception) { @@ -406,13 +410,14 @@ public class AccessControlWebService extends AbstractWebService implements Acces { try { - return TransactionUtil.executeInUserTransaction(this.transactionService, new TransactionWork() + RetryingTransactionCallback callback = new RetryingTransactionCallback() { - public HasPermissionsResult[] doWork() throws Exception + public HasPermissionsResult[] execute() throws Exception { return hasPermissionsImpl(predicate, permissions); } - }); + }; + return transactionService.getRetryingTransactionHelper().doInTransaction(callback); } catch (Throwable exception) { @@ -465,13 +470,14 @@ public class AccessControlWebService extends AbstractWebService implements Acces { try { - return TransactionUtil.executeInUserTransaction(this.transactionService, new TransactionWork() + RetryingTransactionCallback callback = new RetryingTransactionCallback() { - public ACL[] doWork() throws Exception + public ACL[] execute() throws Exception { return setInheritPermissionImpl(predicate, inheritPermission); } - }); + }; + return transactionService.getRetryingTransactionHelper().doInTransaction(callback); } catch (Throwable exception) { @@ -518,13 +524,14 @@ public class AccessControlWebService extends AbstractWebService implements Acces { try { - return TransactionUtil.executeInUserTransaction(this.transactionService, new TransactionWork() + RetryingTransactionCallback callback = new RetryingTransactionCallback() { - public OwnerResult[] doWork() throws Exception + public OwnerResult[] execute() throws Exception { return getOwnersImpl(predicate); } - }); + }; + return transactionService.getRetryingTransactionHelper().doInTransaction(callback); } catch (Throwable exception) { @@ -570,13 +577,14 @@ public class AccessControlWebService extends AbstractWebService implements Acces { try { - return TransactionUtil.executeInUserTransaction(this.transactionService, new TransactionWork() + RetryingTransactionCallback callback = new RetryingTransactionCallback() { - public OwnerResult[] doWork() throws Exception + public OwnerResult[] execute() throws Exception { return setOwnersImpl(predicate, owner); } - }); + }; + return transactionService.getRetryingTransactionHelper().doInTransaction(callback); } catch (Throwable exception) { diff --git a/source/java/org/alfresco/repo/webservice/action/ActionWebService.java b/source/java/org/alfresco/repo/webservice/action/ActionWebService.java index e553f04391..8291cb9d6c 100644 --- a/source/java/org/alfresco/repo/webservice/action/ActionWebService.java +++ b/source/java/org/alfresco/repo/webservice/action/ActionWebService.java @@ -36,8 +36,7 @@ import org.alfresco.repo.action.CompositeActionImpl; import org.alfresco.repo.action.executer.ActionExecuter; import org.alfresco.repo.action.executer.CompositeActionExecuter; import org.alfresco.repo.transaction.TransactionServiceImpl; -import org.alfresco.repo.transaction.TransactionUtil; -import org.alfresco.repo.transaction.TransactionUtil.TransactionWork; +import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback; import org.alfresco.repo.webservice.AbstractWebService; import org.alfresco.repo.webservice.Utils; import org.alfresco.repo.webservice.types.NamedValue; @@ -133,13 +132,14 @@ public class ActionWebService extends AbstractWebService implements ActionServic { try { - return TransactionUtil.executeInUserTransaction(this.transactionService, new TransactionWork() + RetryingTransactionCallback callback = new RetryingTransactionCallback() { - public ActionItemDefinition[] doWork() throws Exception + public ActionItemDefinition[] execute() throws Exception { return getConditionDefintionsImpl(); } - }); + }; + return transactionService.getRetryingTransactionHelper().doInTransaction(callback); } catch (Throwable exception) { @@ -182,13 +182,14 @@ public class ActionWebService extends AbstractWebService implements ActionServic { try { - return TransactionUtil.executeInUserTransaction(this.transactionService, new TransactionWork() + RetryingTransactionCallback callback = new RetryingTransactionCallback() { - public ActionItemDefinition[] doWork() throws Exception + public ActionItemDefinition[] execute() throws Exception { return getActionDefinitionsImpl(); } - }); + }; + return transactionService.getRetryingTransactionHelper().doInTransaction(callback); } catch (Throwable exception) { @@ -230,13 +231,14 @@ public class ActionWebService extends AbstractWebService implements ActionServic { try { - return TransactionUtil.executeInUserTransaction(this.transactionService, new TransactionWork() + RetryingTransactionCallback callback = new RetryingTransactionCallback() { - public ActionItemDefinition doWork() throws Exception + public ActionItemDefinition execute() throws Exception { return getActionItemDefinitionImpl(name, definitionType); } - }); + }; + return transactionService.getRetryingTransactionHelper().doInTransaction(callback); } catch (Throwable exception) { @@ -324,13 +326,14 @@ public class ActionWebService extends AbstractWebService implements ActionServic { try { - return TransactionUtil.executeInUserTransaction(this.transactionService, new TransactionWork() + RetryingTransactionCallback callback = new RetryingTransactionCallback() { - public org.alfresco.repo.webservice.action.RuleType[] doWork() throws Exception + public org.alfresco.repo.webservice.action.RuleType[] execute() throws Exception { return getRuleTypesImpl(); } - }); + }; + return transactionService.getRetryingTransactionHelper().doInTransaction(callback); } catch (Throwable exception) { @@ -370,13 +373,14 @@ public class ActionWebService extends AbstractWebService implements ActionServic { try { - return TransactionUtil.executeInUserTransaction(this.transactionService, new TransactionWork() + RetryingTransactionCallback callback = new RetryingTransactionCallback() { - public org.alfresco.repo.webservice.action.RuleType doWork() throws Exception + public org.alfresco.repo.webservice.action.RuleType execute() throws Exception { return getRuleTypeImpl(name); } - }); + }; + return transactionService.getRetryingTransactionHelper().doInTransaction(callback); } catch (Throwable exception) { @@ -409,13 +413,14 @@ public class ActionWebService extends AbstractWebService implements ActionServic { try { - return TransactionUtil.executeInUserTransaction(this.transactionService, new TransactionWork() + RetryingTransactionCallback callback = new RetryingTransactionCallback() { - public org.alfresco.repo.webservice.action.Action[] doWork() throws Exception + public org.alfresco.repo.webservice.action.Action[] execute() throws Exception { return getActionsImpl(reference, filter); } - }); + }; + return transactionService.getRetryingTransactionHelper().doInTransaction(callback); } catch (Throwable exception) { @@ -568,13 +573,14 @@ public class ActionWebService extends AbstractWebService implements ActionServic { try { - return TransactionUtil.executeInUserTransaction(this.transactionService, new TransactionWork() + RetryingTransactionCallback callback = new RetryingTransactionCallback() { - public org.alfresco.repo.webservice.action.Action[] doWork() throws Exception + public org.alfresco.repo.webservice.action.Action[] execute() throws Exception { return saveActionsImpl(reference, webServiceActions); } - }); + }; + return transactionService.getRetryingTransactionHelper().doInTransaction(callback); } catch (Throwable exception) { @@ -783,14 +789,15 @@ public class ActionWebService extends AbstractWebService implements ActionServic { try { - TransactionUtil.executeInUserTransaction(this.transactionService, new TransactionWork() + RetryingTransactionCallback callback = new RetryingTransactionCallback() { - public Object doWork() throws Exception + public Object execute() throws Exception { removeActionsImpl(reference, webServiceActions); return null; } - }); + }; + transactionService.getRetryingTransactionHelper().doInTransaction(callback); } catch (Throwable exception) { @@ -831,13 +838,14 @@ public class ActionWebService extends AbstractWebService implements ActionServic { try { - return TransactionUtil.executeInUserTransaction(this.transactionService, new TransactionWork() + RetryingTransactionCallback callback = new RetryingTransactionCallback() { - public ActionExecutionResult[] doWork() throws Exception + public ActionExecutionResult[] execute() throws Exception { return executeActionsImpl(predicate, webServiceActions); } - }); + }; + return transactionService.getRetryingTransactionHelper().doInTransaction(callback); } catch (Throwable exception) { @@ -931,13 +939,14 @@ public class ActionWebService extends AbstractWebService implements ActionServic { try { - return TransactionUtil.executeInUserTransaction(this.transactionService, new TransactionWork() + RetryingTransactionCallback callback = new RetryingTransactionCallback() { - public org.alfresco.repo.webservice.action.Rule[] doWork() throws Exception + public org.alfresco.repo.webservice.action.Rule[] execute() throws Exception { return getRulesImpl(reference, ruleFilter); } - }); + }; + return transactionService.getRetryingTransactionHelper().doInTransaction(callback); } catch (Throwable exception) { @@ -1005,13 +1014,14 @@ public class ActionWebService extends AbstractWebService implements ActionServic { try { - return TransactionUtil.executeInUserTransaction(this.transactionService, new TransactionWork() + RetryingTransactionCallback callback = new RetryingTransactionCallback() { - public org.alfresco.repo.webservice.action.Rule[] doWork() throws Exception + public org.alfresco.repo.webservice.action.Rule[] execute() throws Exception { return saveRulesImpl(reference, webServiceRules); } - }); + }; + return transactionService.getRetryingTransactionHelper().doInTransaction(callback); } catch (Throwable exception) { @@ -1058,14 +1068,15 @@ public class ActionWebService extends AbstractWebService implements ActionServic { try { - TransactionUtil.executeInUserTransaction(this.transactionService, new TransactionWork() + RetryingTransactionCallback callback = new RetryingTransactionCallback() { - public Object doWork() throws Exception + public Object execute() throws Exception { removeRulesImpl(reference, webServiceRules); return null; } - }); + }; + transactionService.getRetryingTransactionHelper().doInTransaction(callback); } catch (Throwable exception) { diff --git a/source/java/org/alfresco/repo/webservice/administration/AdministrationWebService.java b/source/java/org/alfresco/repo/webservice/administration/AdministrationWebService.java index be7753c0a5..9669897839 100644 --- a/source/java/org/alfresco/repo/webservice/administration/AdministrationWebService.java +++ b/source/java/org/alfresco/repo/webservice/administration/AdministrationWebService.java @@ -36,8 +36,7 @@ import java.util.Set; import org.alfresco.model.ContentModel; import org.alfresco.repo.cache.SimpleCache; -import org.alfresco.repo.transaction.TransactionUtil; -import org.alfresco.repo.transaction.TransactionUtil.TransactionWork; +import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback; import org.alfresco.repo.webservice.AbstractWebService; import org.alfresco.repo.webservice.Utils; import org.alfresco.repo.webservice.action.ActionFault; @@ -138,13 +137,14 @@ public class AdministrationWebService extends AbstractWebService implements { try { - return TransactionUtil.executeInUserTransaction(this.transactionService, new TransactionWork() + RetryingTransactionCallback callback = new RetryingTransactionCallback() { - public UserQueryResults doWork() throws Exception + public UserQueryResults execute() throws Exception { return queryUsersImpl(filter); } - }); + }; + return transactionService.getRetryingTransactionHelper().doInTransaction(callback); } catch (Throwable exception) { @@ -189,13 +189,14 @@ public class AdministrationWebService extends AbstractWebService implements { try { - return TransactionUtil.executeInUserTransaction(this.transactionService, new TransactionWork() + RetryingTransactionCallback callback = new RetryingTransactionCallback() { - public UserQueryResults doWork() throws Exception + public UserQueryResults execute() throws Exception { return fetchMoreUsersImpl(querySession); } - }); + }; + return transactionService.getRetryingTransactionHelper().doInTransaction(callback); } catch (Throwable exception) { @@ -237,13 +238,14 @@ public class AdministrationWebService extends AbstractWebService implements { try { - return TransactionUtil.executeInUserTransaction(this.transactionService, new TransactionWork() + RetryingTransactionCallback callback = new RetryingTransactionCallback() { - public UserDetails doWork() throws Exception + public UserDetails execute() throws Exception { return getUserImpl(userName); } - }); + }; + return transactionService.getRetryingTransactionHelper().doInTransaction(callback); } catch (Throwable exception) { @@ -331,13 +333,14 @@ public class AdministrationWebService extends AbstractWebService implements { try { - return TransactionUtil.executeInUserTransaction(this.transactionService, new TransactionWork() + RetryingTransactionCallback callback = new RetryingTransactionCallback() { - public UserDetails[] doWork() throws Exception + public UserDetails[] execute() throws Exception { return createUsersImpl(newUsers); } - }); + }; + return transactionService.getRetryingTransactionHelper().doInTransaction(callback); } catch (Throwable exception) { @@ -392,13 +395,14 @@ public class AdministrationWebService extends AbstractWebService implements { try { - return TransactionUtil.executeInUserTransaction(this.transactionService, new TransactionWork() + RetryingTransactionCallback callback = new RetryingTransactionCallback() { - public UserDetails[] doWork() throws Exception + public UserDetails[] execute() throws Exception { return updateUsersImpl(users); } - }); + }; + return transactionService.getRetryingTransactionHelper().doInTransaction(callback); } catch (Throwable exception) { @@ -451,14 +455,15 @@ public class AdministrationWebService extends AbstractWebService implements { try { - TransactionUtil.executeInUserTransaction(this.transactionService, new TransactionWork() + RetryingTransactionCallback callback = new RetryingTransactionCallback() { - public Object doWork() throws Exception + public Object execute() throws Exception { changePasswordImpl(userName, oldPassword, newPassword); return null; } - }); + }; + transactionService.getRetryingTransactionHelper().doInTransaction(callback); } catch (Throwable exception) { @@ -499,14 +504,15 @@ public class AdministrationWebService extends AbstractWebService implements { try { - TransactionUtil.executeInUserTransaction(this.transactionService, new TransactionWork() + RetryingTransactionCallback callback = new RetryingTransactionCallback() { - public Object doWork() throws Exception + public Object execute() throws Exception { deleteUsersImpl(userNames); return null; } - }); + }; + transactionService.getRetryingTransactionHelper().doInTransaction(callback); } catch (Throwable exception) { diff --git a/source/java/org/alfresco/repo/webservice/authoring/AuthoringWebService.java b/source/java/org/alfresco/repo/webservice/authoring/AuthoringWebService.java index f7c229533b..206091ead2 100644 --- a/source/java/org/alfresco/repo/webservice/authoring/AuthoringWebService.java +++ b/source/java/org/alfresco/repo/webservice/authoring/AuthoringWebService.java @@ -35,7 +35,7 @@ import java.util.List; import java.util.Map; import org.alfresco.model.ContentModel; -import org.alfresco.repo.transaction.TransactionUtil; +import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback; import org.alfresco.repo.webservice.AbstractWebService; import org.alfresco.repo.webservice.Utils; import org.alfresco.repo.webservice.types.ContentFormat; @@ -142,11 +142,10 @@ public class AuthoringWebService extends AbstractWebService implements { try { - return TransactionUtil.executeInUserTransaction( - this.transactionService, - new TransactionUtil.TransactionWork() + return transactionService.getRetryingTransactionHelper().doInTransaction( + new RetryingTransactionCallback() { - public CheckoutResult doWork() + public CheckoutResult execute() { List nodes = Utils.resolvePredicate(items, AuthoringWebService.this.nodeService, @@ -224,11 +223,10 @@ public class AuthoringWebService extends AbstractWebService implements { try { - return TransactionUtil.executeInUserTransaction( - this.transactionService, - new TransactionUtil.TransactionWork() + return transactionService.getRetryingTransactionHelper().doInTransaction( + new RetryingTransactionCallback() { - public CheckinResult doWork() + public CheckinResult execute() { // Get the passed nodes List nodes = Utils.resolvePredicate( @@ -301,11 +299,10 @@ public class AuthoringWebService extends AbstractWebService implements { try { - return TransactionUtil.executeInUserTransaction( - this.transactionService, - new TransactionUtil.TransactionWork() + return transactionService.getRetryingTransactionHelper().doInTransaction( + new RetryingTransactionCallback() { - public Reference doWork() + public Reference execute() { // Get the passed nodes NodeRef nodeRef = Utils.convertToNodeRef( @@ -364,11 +361,10 @@ public class AuthoringWebService extends AbstractWebService implements { try { - return TransactionUtil.executeInUserTransaction( - this.transactionService, - new TransactionUtil.TransactionWork() + return transactionService.getRetryingTransactionHelper().doInTransaction( + new RetryingTransactionCallback() { - public CancelCheckoutResult doWork() + public CancelCheckoutResult execute() { // Get the passed nodes List nodes = Utils.resolvePredicate( @@ -421,11 +417,10 @@ public class AuthoringWebService extends AbstractWebService implements { try { - return TransactionUtil.executeInUserTransaction( - this.transactionService, - new TransactionUtil.TransactionWork() + return transactionService.getRetryingTransactionHelper().doInTransaction( + new RetryingTransactionCallback() { - public Reference[] doWork() + public Reference[] execute() { // Get the passed nodes List nodes = Utils.resolvePredicate( @@ -489,11 +484,10 @@ public class AuthoringWebService extends AbstractWebService implements { try { - return TransactionUtil.executeInUserTransaction( - this.transactionService, - new TransactionUtil.TransactionWork() + return transactionService.getRetryingTransactionHelper().doInTransaction( + new RetryingTransactionCallback() { - public Reference[] doWork() + public Reference[] execute() { // Get the passed nodes List nodes = Utils.resolvePredicate( @@ -536,11 +530,10 @@ public class AuthoringWebService extends AbstractWebService implements { try { - return TransactionUtil.executeInUserTransaction( - this.transactionService, - new TransactionUtil.TransactionWork() + return transactionService.getRetryingTransactionHelper().doInTransaction( + new RetryingTransactionCallback() { - public LockStatus[] doWork() + public LockStatus[] execute() { // Get the passed nodes List nodes = Utils.resolvePredicate( @@ -613,11 +606,10 @@ public class AuthoringWebService extends AbstractWebService implements { try { - return TransactionUtil.executeInUserTransaction( - this.transactionService, - new TransactionUtil.TransactionWork() + return transactionService.getRetryingTransactionHelper().doInTransaction( + new RetryingTransactionCallback() { - public VersionResult doWork() + public VersionResult execute() { // Get the passed nodes List nodes = Utils.resolvePredicate( @@ -675,11 +667,10 @@ public class AuthoringWebService extends AbstractWebService implements { try { - return TransactionUtil.executeInUserTransaction( - this.transactionService, - new TransactionUtil.TransactionWork() + return transactionService.getRetryingTransactionHelper().doInTransaction( + new RetryingTransactionCallback() { - public VersionHistory doWork() + public VersionHistory execute() { org.alfresco.service.cmr.version.VersionHistory versionHistory = AuthoringWebService.this.versionService.getVersionHistory( @@ -728,11 +719,10 @@ public class AuthoringWebService extends AbstractWebService implements { try { - TransactionUtil.executeInUserTransaction( - this.transactionService, - new TransactionUtil.TransactionWork() + transactionService.getRetryingTransactionHelper().doInTransaction( + new RetryingTransactionCallback() { - public Object doWork() + public Object execute() { NodeRef nodeRef = Utils.convertToNodeRef( node, @@ -781,11 +771,10 @@ public class AuthoringWebService extends AbstractWebService implements { try { - return TransactionUtil.executeInUserTransaction( - this.transactionService, - new TransactionUtil.TransactionWork() + return transactionService.getRetryingTransactionHelper().doInTransaction( + new RetryingTransactionCallback() { - public VersionHistory doWork() + public VersionHistory execute() { NodeRef nodeRef = Utils.convertToNodeRef( node, diff --git a/source/java/org/alfresco/repo/webservice/classification/ClassificationWebService.java b/source/java/org/alfresco/repo/webservice/classification/ClassificationWebService.java index e8de1ee49d..1f666cca90 100644 --- a/source/java/org/alfresco/repo/webservice/classification/ClassificationWebService.java +++ b/source/java/org/alfresco/repo/webservice/classification/ClassificationWebService.java @@ -31,7 +31,7 @@ import java.util.List; 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.repo.webservice.AbstractWebService; import org.alfresco.repo.webservice.Utils; import org.alfresco.repo.webservice.types.Category; @@ -117,11 +117,10 @@ public class ClassificationWebService extends AbstractWebService implements { try { - return TransactionUtil.executeInUserTransaction( - this.transactionService, - new TransactionUtil.TransactionWork() + return transactionService.getRetryingTransactionHelper().doInTransaction( + new RetryingTransactionCallback() { - public Classification[] doWork() + public Classification[] execute() { List classifications = new ArrayList(); @@ -198,11 +197,10 @@ public class ClassificationWebService extends AbstractWebService implements { try { - return TransactionUtil.executeInUserTransaction( - this.transactionService, - new TransactionUtil.TransactionWork() + return transactionService.getRetryingTransactionHelper().doInTransaction( + new RetryingTransactionCallback() { - public Category[] doWork() + public Category[] execute() { NodeRef parentNodeRef = Utils.convertToNodeRef( parentCategory, @@ -246,11 +244,10 @@ public class ClassificationWebService extends AbstractWebService implements { try { - return TransactionUtil.executeInUserTransaction( - this.transactionService, - new TransactionUtil.TransactionWork() + return transactionService.getRetryingTransactionHelper().doInTransaction( + new RetryingTransactionCallback() { - public CategoriesResult[] doWork() + public CategoriesResult[] execute() { List result = new ArrayList(); @@ -354,11 +351,10 @@ public class ClassificationWebService extends AbstractWebService implements { try { - return TransactionUtil.executeInUserTransaction( - this.transactionService, - new TransactionUtil.TransactionWork() + return transactionService.getRetryingTransactionHelper().doInTransaction( + new RetryingTransactionCallback() { - public CategoriesResult[] doWork() + public CategoriesResult[] execute() { List result = new ArrayList(); @@ -437,11 +433,10 @@ public class ClassificationWebService extends AbstractWebService implements { try { - return TransactionUtil.executeInUserTransaction( - this.transactionService, - new TransactionUtil.TransactionWork() + return transactionService.getRetryingTransactionHelper().doInTransaction( + new RetryingTransactionCallback() { - public ClassDefinition doWork() + public ClassDefinition execute() { org.alfresco.service.cmr.dictionary.ClassDefinition classDefinition = ClassificationWebService.this.dictionaryService.getClass(QName.createQName(classification)); return Utils.setupClassDefObject(classDefinition);