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 2c4637723f
commit 0d8df71921
5 changed files with 165 additions and 156 deletions

View File

@@ -6,8 +6,7 @@ import java.util.List;
import java.util.Set; import java.util.Set;
import org.alfresco.repo.transaction.TransactionServiceImpl; import org.alfresco.repo.transaction.TransactionServiceImpl;
import org.alfresco.repo.transaction.TransactionUtil; import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback;
import org.alfresco.repo.transaction.TransactionUtil.TransactionWork;
import org.alfresco.repo.webservice.AbstractWebService; import org.alfresco.repo.webservice.AbstractWebService;
import org.alfresco.repo.webservice.Utils; import org.alfresco.repo.webservice.Utils;
import org.alfresco.repo.webservice.action.ActionFault; import org.alfresco.repo.webservice.action.ActionFault;
@@ -72,13 +71,14 @@ public class AccessControlWebService extends AbstractWebService implements Acces
{ {
try try
{ {
return TransactionUtil.executeInUserTransaction(this.transactionService, new TransactionWork<ACL[]>() RetryingTransactionCallback<ACL[]> callback = new RetryingTransactionCallback<ACL[]>()
{ {
public ACL[] doWork() throws Exception public ACL[] execute() throws Exception
{ {
return getACLsImpl(predicate, filter); return getACLsImpl(predicate, filter);
} }
}); };
return transactionService.getRetryingTransactionHelper().doInTransaction(callback);
} }
catch (Throwable exception) catch (Throwable exception)
{ {
@@ -167,13 +167,14 @@ public class AccessControlWebService extends AbstractWebService implements Acces
{ {
try try
{ {
return TransactionUtil.executeInUserTransaction(this.transactionService, new TransactionWork<ACL[]>() RetryingTransactionCallback<ACL[]> callback = new RetryingTransactionCallback<ACL[]>()
{ {
public ACL[] doWork() throws Exception public ACL[] execute() throws Exception
{ {
return addACEsImpl(predicate, aces); return addACEsImpl(predicate, aces);
} }
}); };
return transactionService.getRetryingTransactionHelper().doInTransaction(callback);
} }
catch (Throwable exception) catch (Throwable exception)
{ {
@@ -229,13 +230,14 @@ public class AccessControlWebService extends AbstractWebService implements Acces
{ {
try try
{ {
return TransactionUtil.executeInUserTransaction(this.transactionService, new TransactionWork<ACL[]>() RetryingTransactionCallback<ACL[]> callback = new RetryingTransactionCallback<ACL[]>()
{ {
public ACL[] doWork() throws Exception public ACL[] execute() throws Exception
{ {
return removeACEsImpl(predicate, aces); return removeACEsImpl(predicate, aces);
} }
}); };
return transactionService.getRetryingTransactionHelper().doInTransaction(callback);
} }
catch (Throwable exception) catch (Throwable exception)
{ {
@@ -293,13 +295,14 @@ public class AccessControlWebService extends AbstractWebService implements Acces
{ {
try try
{ {
return TransactionUtil.executeInUserTransaction(this.transactionService, new TransactionWork<GetPermissionsResult[]>() RetryingTransactionCallback<GetPermissionsResult[]> callback = new RetryingTransactionCallback<GetPermissionsResult[]>()
{ {
public GetPermissionsResult[] doWork() throws Exception public GetPermissionsResult[] execute() throws Exception
{ {
return getPermissionsImpl(predicate); return getPermissionsImpl(predicate);
} }
}); };
return transactionService.getRetryingTransactionHelper().doInTransaction(callback);
} }
catch (Throwable exception) catch (Throwable exception)
{ {
@@ -350,13 +353,14 @@ public class AccessControlWebService extends AbstractWebService implements Acces
{ {
try try
{ {
return TransactionUtil.executeInUserTransaction(this.transactionService, new TransactionWork<GetClassPermissionsResult[]>() RetryingTransactionCallback<GetClassPermissionsResult[]> callback = new RetryingTransactionCallback<GetClassPermissionsResult[]>()
{ {
public GetClassPermissionsResult[] doWork() throws Exception public GetClassPermissionsResult[] execute() throws Exception
{ {
return getClassPermissionsImpl(classNames); return getClassPermissionsImpl(classNames);
} }
}); };
return transactionService.getRetryingTransactionHelper().doInTransaction(callback);
} }
catch (Throwable exception) catch (Throwable exception)
{ {
@@ -406,13 +410,14 @@ public class AccessControlWebService extends AbstractWebService implements Acces
{ {
try try
{ {
return TransactionUtil.executeInUserTransaction(this.transactionService, new TransactionWork<HasPermissionsResult[]>() RetryingTransactionCallback<HasPermissionsResult[]> callback = new RetryingTransactionCallback<HasPermissionsResult[]>()
{ {
public HasPermissionsResult[] doWork() throws Exception public HasPermissionsResult[] execute() throws Exception
{ {
return hasPermissionsImpl(predicate, permissions); return hasPermissionsImpl(predicate, permissions);
} }
}); };
return transactionService.getRetryingTransactionHelper().doInTransaction(callback);
} }
catch (Throwable exception) catch (Throwable exception)
{ {
@@ -465,13 +470,14 @@ public class AccessControlWebService extends AbstractWebService implements Acces
{ {
try try
{ {
return TransactionUtil.executeInUserTransaction(this.transactionService, new TransactionWork<ACL[]>() RetryingTransactionCallback<ACL[]> callback = new RetryingTransactionCallback<ACL[]>()
{ {
public ACL[] doWork() throws Exception public ACL[] execute() throws Exception
{ {
return setInheritPermissionImpl(predicate, inheritPermission); return setInheritPermissionImpl(predicate, inheritPermission);
} }
}); };
return transactionService.getRetryingTransactionHelper().doInTransaction(callback);
} }
catch (Throwable exception) catch (Throwable exception)
{ {
@@ -518,13 +524,14 @@ public class AccessControlWebService extends AbstractWebService implements Acces
{ {
try try
{ {
return TransactionUtil.executeInUserTransaction(this.transactionService, new TransactionWork<OwnerResult[]>() RetryingTransactionCallback<OwnerResult[]> callback = new RetryingTransactionCallback<OwnerResult[]>()
{ {
public OwnerResult[] doWork() throws Exception public OwnerResult[] execute() throws Exception
{ {
return getOwnersImpl(predicate); return getOwnersImpl(predicate);
} }
}); };
return transactionService.getRetryingTransactionHelper().doInTransaction(callback);
} }
catch (Throwable exception) catch (Throwable exception)
{ {
@@ -570,13 +577,14 @@ public class AccessControlWebService extends AbstractWebService implements Acces
{ {
try try
{ {
return TransactionUtil.executeInUserTransaction(this.transactionService, new TransactionWork<OwnerResult[]>() RetryingTransactionCallback<OwnerResult[]> callback = new RetryingTransactionCallback<OwnerResult[]>()
{ {
public OwnerResult[] doWork() throws Exception public OwnerResult[] execute() throws Exception
{ {
return setOwnersImpl(predicate, owner); return setOwnersImpl(predicate, owner);
} }
}); };
return transactionService.getRetryingTransactionHelper().doInTransaction(callback);
} }
catch (Throwable exception) catch (Throwable exception)
{ {

View File

@@ -36,8 +36,7 @@ import org.alfresco.repo.action.CompositeActionImpl;
import org.alfresco.repo.action.executer.ActionExecuter; import org.alfresco.repo.action.executer.ActionExecuter;
import org.alfresco.repo.action.executer.CompositeActionExecuter; import org.alfresco.repo.action.executer.CompositeActionExecuter;
import org.alfresco.repo.transaction.TransactionServiceImpl; import org.alfresco.repo.transaction.TransactionServiceImpl;
import org.alfresco.repo.transaction.TransactionUtil; import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback;
import org.alfresco.repo.transaction.TransactionUtil.TransactionWork;
import org.alfresco.repo.webservice.AbstractWebService; import org.alfresco.repo.webservice.AbstractWebService;
import org.alfresco.repo.webservice.Utils; import org.alfresco.repo.webservice.Utils;
import org.alfresco.repo.webservice.types.NamedValue; import org.alfresco.repo.webservice.types.NamedValue;
@@ -133,13 +132,14 @@ public class ActionWebService extends AbstractWebService implements ActionServic
{ {
try try
{ {
return TransactionUtil.executeInUserTransaction(this.transactionService, new TransactionWork<ActionItemDefinition[]>() RetryingTransactionCallback<ActionItemDefinition[]> callback = new RetryingTransactionCallback<ActionItemDefinition[]>()
{ {
public ActionItemDefinition[] doWork() throws Exception public ActionItemDefinition[] execute() throws Exception
{ {
return getConditionDefintionsImpl(); return getConditionDefintionsImpl();
} }
}); };
return transactionService.getRetryingTransactionHelper().doInTransaction(callback);
} }
catch (Throwable exception) catch (Throwable exception)
{ {
@@ -182,13 +182,14 @@ public class ActionWebService extends AbstractWebService implements ActionServic
{ {
try try
{ {
return TransactionUtil.executeInUserTransaction(this.transactionService, new TransactionWork<ActionItemDefinition[]>() RetryingTransactionCallback<ActionItemDefinition[]> callback = new RetryingTransactionCallback<ActionItemDefinition[]>()
{ {
public ActionItemDefinition[] doWork() throws Exception public ActionItemDefinition[] execute() throws Exception
{ {
return getActionDefinitionsImpl(); return getActionDefinitionsImpl();
} }
}); };
return transactionService.getRetryingTransactionHelper().doInTransaction(callback);
} }
catch (Throwable exception) catch (Throwable exception)
{ {
@@ -230,13 +231,14 @@ public class ActionWebService extends AbstractWebService implements ActionServic
{ {
try try
{ {
return TransactionUtil.executeInUserTransaction(this.transactionService, new TransactionWork<ActionItemDefinition>() RetryingTransactionCallback<ActionItemDefinition> callback = new RetryingTransactionCallback<ActionItemDefinition>()
{ {
public ActionItemDefinition doWork() throws Exception public ActionItemDefinition execute() throws Exception
{ {
return getActionItemDefinitionImpl(name, definitionType); return getActionItemDefinitionImpl(name, definitionType);
} }
}); };
return transactionService.getRetryingTransactionHelper().doInTransaction(callback);
} }
catch (Throwable exception) catch (Throwable exception)
{ {
@@ -324,13 +326,14 @@ public class ActionWebService extends AbstractWebService implements ActionServic
{ {
try try
{ {
return TransactionUtil.executeInUserTransaction(this.transactionService, new TransactionWork<org.alfresco.repo.webservice.action.RuleType[]>() RetryingTransactionCallback<org.alfresco.repo.webservice.action.RuleType[]> callback = new RetryingTransactionCallback<org.alfresco.repo.webservice.action.RuleType[]>()
{ {
public org.alfresco.repo.webservice.action.RuleType[] doWork() throws Exception public org.alfresco.repo.webservice.action.RuleType[] execute() throws Exception
{ {
return getRuleTypesImpl(); return getRuleTypesImpl();
} }
}); };
return transactionService.getRetryingTransactionHelper().doInTransaction(callback);
} }
catch (Throwable exception) catch (Throwable exception)
{ {
@@ -370,13 +373,14 @@ public class ActionWebService extends AbstractWebService implements ActionServic
{ {
try try
{ {
return TransactionUtil.executeInUserTransaction(this.transactionService, new TransactionWork<org.alfresco.repo.webservice.action.RuleType>() RetryingTransactionCallback<org.alfresco.repo.webservice.action.RuleType> callback = new RetryingTransactionCallback<org.alfresco.repo.webservice.action.RuleType>()
{ {
public org.alfresco.repo.webservice.action.RuleType doWork() throws Exception public org.alfresco.repo.webservice.action.RuleType execute() throws Exception
{ {
return getRuleTypeImpl(name); return getRuleTypeImpl(name);
} }
}); };
return transactionService.getRetryingTransactionHelper().doInTransaction(callback);
} }
catch (Throwable exception) catch (Throwable exception)
{ {
@@ -409,13 +413,14 @@ public class ActionWebService extends AbstractWebService implements ActionServic
{ {
try try
{ {
return TransactionUtil.executeInUserTransaction(this.transactionService, new TransactionWork<org.alfresco.repo.webservice.action.Action[]>() RetryingTransactionCallback<org.alfresco.repo.webservice.action.Action[]> callback = new RetryingTransactionCallback<org.alfresco.repo.webservice.action.Action[]>()
{ {
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 getActionsImpl(reference, filter);
} }
}); };
return transactionService.getRetryingTransactionHelper().doInTransaction(callback);
} }
catch (Throwable exception) catch (Throwable exception)
{ {
@@ -568,13 +573,14 @@ public class ActionWebService extends AbstractWebService implements ActionServic
{ {
try try
{ {
return TransactionUtil.executeInUserTransaction(this.transactionService, new TransactionWork<org.alfresco.repo.webservice.action.Action[]>() RetryingTransactionCallback<org.alfresco.repo.webservice.action.Action[]> callback = new RetryingTransactionCallback<org.alfresco.repo.webservice.action.Action[]>()
{ {
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 saveActionsImpl(reference, webServiceActions);
} }
}); };
return transactionService.getRetryingTransactionHelper().doInTransaction(callback);
} }
catch (Throwable exception) catch (Throwable exception)
{ {
@@ -783,14 +789,15 @@ public class ActionWebService extends AbstractWebService implements ActionServic
{ {
try try
{ {
TransactionUtil.executeInUserTransaction(this.transactionService, new TransactionWork<Object>() RetryingTransactionCallback<Object> callback = new RetryingTransactionCallback<Object>()
{ {
public Object doWork() throws Exception public Object execute() throws Exception
{ {
removeActionsImpl(reference, webServiceActions); removeActionsImpl(reference, webServiceActions);
return null; return null;
} }
}); };
transactionService.getRetryingTransactionHelper().doInTransaction(callback);
} }
catch (Throwable exception) catch (Throwable exception)
{ {
@@ -831,13 +838,14 @@ public class ActionWebService extends AbstractWebService implements ActionServic
{ {
try try
{ {
return TransactionUtil.executeInUserTransaction(this.transactionService, new TransactionWork<ActionExecutionResult[]>() RetryingTransactionCallback<ActionExecutionResult[]> callback = new RetryingTransactionCallback<ActionExecutionResult[]>()
{ {
public ActionExecutionResult[] doWork() throws Exception public ActionExecutionResult[] execute() throws Exception
{ {
return executeActionsImpl(predicate, webServiceActions); return executeActionsImpl(predicate, webServiceActions);
} }
}); };
return transactionService.getRetryingTransactionHelper().doInTransaction(callback);
} }
catch (Throwable exception) catch (Throwable exception)
{ {
@@ -931,13 +939,14 @@ public class ActionWebService extends AbstractWebService implements ActionServic
{ {
try try
{ {
return TransactionUtil.executeInUserTransaction(this.transactionService, new TransactionWork<org.alfresco.repo.webservice.action.Rule[]>() RetryingTransactionCallback<org.alfresco.repo.webservice.action.Rule[]> callback = new RetryingTransactionCallback<org.alfresco.repo.webservice.action.Rule[]>()
{ {
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 getRulesImpl(reference, ruleFilter);
} }
}); };
return transactionService.getRetryingTransactionHelper().doInTransaction(callback);
} }
catch (Throwable exception) catch (Throwable exception)
{ {
@@ -1005,13 +1014,14 @@ public class ActionWebService extends AbstractWebService implements ActionServic
{ {
try try
{ {
return TransactionUtil.executeInUserTransaction(this.transactionService, new TransactionWork<org.alfresco.repo.webservice.action.Rule[]>() RetryingTransactionCallback<org.alfresco.repo.webservice.action.Rule[]> callback = new RetryingTransactionCallback<org.alfresco.repo.webservice.action.Rule[]>()
{ {
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 saveRulesImpl(reference, webServiceRules);
} }
}); };
return transactionService.getRetryingTransactionHelper().doInTransaction(callback);
} }
catch (Throwable exception) catch (Throwable exception)
{ {
@@ -1058,14 +1068,15 @@ public class ActionWebService extends AbstractWebService implements ActionServic
{ {
try try
{ {
TransactionUtil.executeInUserTransaction(this.transactionService, new TransactionWork<Object>() RetryingTransactionCallback<Object> callback = new RetryingTransactionCallback<Object>()
{ {
public Object doWork() throws Exception public Object execute() throws Exception
{ {
removeRulesImpl(reference, webServiceRules); removeRulesImpl(reference, webServiceRules);
return null; return null;
} }
}); };
transactionService.getRetryingTransactionHelper().doInTransaction(callback);
} }
catch (Throwable exception) catch (Throwable exception)
{ {

View File

@@ -36,8 +36,7 @@ import java.util.Set;
import org.alfresco.model.ContentModel; import org.alfresco.model.ContentModel;
import org.alfresco.repo.cache.SimpleCache; import org.alfresco.repo.cache.SimpleCache;
import org.alfresco.repo.transaction.TransactionUtil; import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback;
import org.alfresco.repo.transaction.TransactionUtil.TransactionWork;
import org.alfresco.repo.webservice.AbstractWebService; import org.alfresco.repo.webservice.AbstractWebService;
import org.alfresco.repo.webservice.Utils; import org.alfresco.repo.webservice.Utils;
import org.alfresco.repo.webservice.action.ActionFault; import org.alfresco.repo.webservice.action.ActionFault;
@@ -138,13 +137,14 @@ public class AdministrationWebService extends AbstractWebService implements
{ {
try try
{ {
return TransactionUtil.executeInUserTransaction(this.transactionService, new TransactionWork<UserQueryResults>() RetryingTransactionCallback<UserQueryResults> callback = new RetryingTransactionCallback<UserQueryResults>()
{ {
public UserQueryResults doWork() throws Exception public UserQueryResults execute() throws Exception
{ {
return queryUsersImpl(filter); return queryUsersImpl(filter);
} }
}); };
return transactionService.getRetryingTransactionHelper().doInTransaction(callback);
} }
catch (Throwable exception) catch (Throwable exception)
{ {
@@ -189,13 +189,14 @@ public class AdministrationWebService extends AbstractWebService implements
{ {
try try
{ {
return TransactionUtil.executeInUserTransaction(this.transactionService, new TransactionWork<UserQueryResults>() RetryingTransactionCallback<UserQueryResults> callback = new RetryingTransactionCallback<UserQueryResults>()
{ {
public UserQueryResults doWork() throws Exception public UserQueryResults execute() throws Exception
{ {
return fetchMoreUsersImpl(querySession); return fetchMoreUsersImpl(querySession);
} }
}); };
return transactionService.getRetryingTransactionHelper().doInTransaction(callback);
} }
catch (Throwable exception) catch (Throwable exception)
{ {
@@ -237,13 +238,14 @@ public class AdministrationWebService extends AbstractWebService implements
{ {
try try
{ {
return TransactionUtil.executeInUserTransaction(this.transactionService, new TransactionWork<UserDetails>() RetryingTransactionCallback<UserDetails> callback = new RetryingTransactionCallback<UserDetails>()
{ {
public UserDetails doWork() throws Exception public UserDetails execute() throws Exception
{ {
return getUserImpl(userName); return getUserImpl(userName);
} }
}); };
return transactionService.getRetryingTransactionHelper().doInTransaction(callback);
} }
catch (Throwable exception) catch (Throwable exception)
{ {
@@ -331,13 +333,14 @@ public class AdministrationWebService extends AbstractWebService implements
{ {
try try
{ {
return TransactionUtil.executeInUserTransaction(this.transactionService, new TransactionWork<UserDetails[]>() RetryingTransactionCallback<UserDetails[]> callback = new RetryingTransactionCallback<UserDetails[]>()
{ {
public UserDetails[] doWork() throws Exception public UserDetails[] execute() throws Exception
{ {
return createUsersImpl(newUsers); return createUsersImpl(newUsers);
} }
}); };
return transactionService.getRetryingTransactionHelper().doInTransaction(callback);
} }
catch (Throwable exception) catch (Throwable exception)
{ {
@@ -392,13 +395,14 @@ public class AdministrationWebService extends AbstractWebService implements
{ {
try try
{ {
return TransactionUtil.executeInUserTransaction(this.transactionService, new TransactionWork<UserDetails[]>() RetryingTransactionCallback<UserDetails[]> callback = new RetryingTransactionCallback<UserDetails[]>()
{ {
public UserDetails[] doWork() throws Exception public UserDetails[] execute() throws Exception
{ {
return updateUsersImpl(users); return updateUsersImpl(users);
} }
}); };
return transactionService.getRetryingTransactionHelper().doInTransaction(callback);
} }
catch (Throwable exception) catch (Throwable exception)
{ {
@@ -451,14 +455,15 @@ public class AdministrationWebService extends AbstractWebService implements
{ {
try try
{ {
TransactionUtil.executeInUserTransaction(this.transactionService, new TransactionWork<Object>() RetryingTransactionCallback<Object> callback = new RetryingTransactionCallback<Object>()
{ {
public Object doWork() throws Exception public Object execute() throws Exception
{ {
changePasswordImpl(userName, oldPassword, newPassword); changePasswordImpl(userName, oldPassword, newPassword);
return null; return null;
} }
}); };
transactionService.getRetryingTransactionHelper().doInTransaction(callback);
} }
catch (Throwable exception) catch (Throwable exception)
{ {
@@ -499,14 +504,15 @@ public class AdministrationWebService extends AbstractWebService implements
{ {
try try
{ {
TransactionUtil.executeInUserTransaction(this.transactionService, new TransactionWork<Object>() RetryingTransactionCallback<Object> callback = new RetryingTransactionCallback<Object>()
{ {
public Object doWork() throws Exception public Object execute() throws Exception
{ {
deleteUsersImpl(userNames); deleteUsersImpl(userNames);
return null; return null;
} }
}); };
transactionService.getRetryingTransactionHelper().doInTransaction(callback);
} }
catch (Throwable exception) catch (Throwable exception)
{ {

View File

@@ -35,7 +35,7 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import org.alfresco.model.ContentModel; 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.AbstractWebService;
import org.alfresco.repo.webservice.Utils; import org.alfresco.repo.webservice.Utils;
import org.alfresco.repo.webservice.types.ContentFormat; import org.alfresco.repo.webservice.types.ContentFormat;
@@ -142,11 +142,10 @@ public class AuthoringWebService extends AbstractWebService implements
{ {
try try
{ {
return TransactionUtil.executeInUserTransaction( return transactionService.getRetryingTransactionHelper().doInTransaction(
this.transactionService, new RetryingTransactionCallback<CheckoutResult>()
new TransactionUtil.TransactionWork<CheckoutResult>()
{ {
public CheckoutResult doWork() public CheckoutResult execute()
{ {
List<NodeRef> nodes = Utils.resolvePredicate(items, List<NodeRef> nodes = Utils.resolvePredicate(items,
AuthoringWebService.this.nodeService, AuthoringWebService.this.nodeService,
@@ -224,11 +223,10 @@ public class AuthoringWebService extends AbstractWebService implements
{ {
try try
{ {
return TransactionUtil.executeInUserTransaction( return transactionService.getRetryingTransactionHelper().doInTransaction(
this.transactionService, new RetryingTransactionCallback<CheckinResult>()
new TransactionUtil.TransactionWork<CheckinResult>()
{ {
public CheckinResult doWork() public CheckinResult execute()
{ {
// Get the passed nodes // Get the passed nodes
List<NodeRef> nodes = Utils.resolvePredicate( List<NodeRef> nodes = Utils.resolvePredicate(
@@ -301,11 +299,10 @@ public class AuthoringWebService extends AbstractWebService implements
{ {
try try
{ {
return TransactionUtil.executeInUserTransaction( return transactionService.getRetryingTransactionHelper().doInTransaction(
this.transactionService, new RetryingTransactionCallback<Reference>()
new TransactionUtil.TransactionWork<Reference>()
{ {
public Reference doWork() public Reference execute()
{ {
// Get the passed nodes // Get the passed nodes
NodeRef nodeRef = Utils.convertToNodeRef( NodeRef nodeRef = Utils.convertToNodeRef(
@@ -364,11 +361,10 @@ public class AuthoringWebService extends AbstractWebService implements
{ {
try try
{ {
return TransactionUtil.executeInUserTransaction( return transactionService.getRetryingTransactionHelper().doInTransaction(
this.transactionService, new RetryingTransactionCallback<CancelCheckoutResult>()
new TransactionUtil.TransactionWork<CancelCheckoutResult>()
{ {
public CancelCheckoutResult doWork() public CancelCheckoutResult execute()
{ {
// Get the passed nodes // Get the passed nodes
List<NodeRef> nodes = Utils.resolvePredicate( List<NodeRef> nodes = Utils.resolvePredicate(
@@ -421,11 +417,10 @@ public class AuthoringWebService extends AbstractWebService implements
{ {
try try
{ {
return TransactionUtil.executeInUserTransaction( return transactionService.getRetryingTransactionHelper().doInTransaction(
this.transactionService, new RetryingTransactionCallback<Reference[]>()
new TransactionUtil.TransactionWork<Reference[]>()
{ {
public Reference[] doWork() public Reference[] execute()
{ {
// Get the passed nodes // Get the passed nodes
List<NodeRef> nodes = Utils.resolvePredicate( List<NodeRef> nodes = Utils.resolvePredicate(
@@ -489,11 +484,10 @@ public class AuthoringWebService extends AbstractWebService implements
{ {
try try
{ {
return TransactionUtil.executeInUserTransaction( return transactionService.getRetryingTransactionHelper().doInTransaction(
this.transactionService, new RetryingTransactionCallback<Reference[]>()
new TransactionUtil.TransactionWork<Reference[]>()
{ {
public Reference[] doWork() public Reference[] execute()
{ {
// Get the passed nodes // Get the passed nodes
List<NodeRef> nodes = Utils.resolvePredicate( List<NodeRef> nodes = Utils.resolvePredicate(
@@ -536,11 +530,10 @@ public class AuthoringWebService extends AbstractWebService implements
{ {
try try
{ {
return TransactionUtil.executeInUserTransaction( return transactionService.getRetryingTransactionHelper().doInTransaction(
this.transactionService, new RetryingTransactionCallback<LockStatus[]>()
new TransactionUtil.TransactionWork<LockStatus[]>()
{ {
public LockStatus[] doWork() public LockStatus[] execute()
{ {
// Get the passed nodes // Get the passed nodes
List<NodeRef> nodes = Utils.resolvePredicate( List<NodeRef> nodes = Utils.resolvePredicate(
@@ -613,11 +606,10 @@ public class AuthoringWebService extends AbstractWebService implements
{ {
try try
{ {
return TransactionUtil.executeInUserTransaction( return transactionService.getRetryingTransactionHelper().doInTransaction(
this.transactionService, new RetryingTransactionCallback<VersionResult>()
new TransactionUtil.TransactionWork<VersionResult>()
{ {
public VersionResult doWork() public VersionResult execute()
{ {
// Get the passed nodes // Get the passed nodes
List<NodeRef> nodes = Utils.resolvePredicate( List<NodeRef> nodes = Utils.resolvePredicate(
@@ -675,11 +667,10 @@ public class AuthoringWebService extends AbstractWebService implements
{ {
try try
{ {
return TransactionUtil.executeInUserTransaction( return transactionService.getRetryingTransactionHelper().doInTransaction(
this.transactionService, new RetryingTransactionCallback<VersionHistory>()
new TransactionUtil.TransactionWork<VersionHistory>()
{ {
public VersionHistory doWork() public VersionHistory execute()
{ {
org.alfresco.service.cmr.version.VersionHistory versionHistory = org.alfresco.service.cmr.version.VersionHistory versionHistory =
AuthoringWebService.this.versionService.getVersionHistory( AuthoringWebService.this.versionService.getVersionHistory(
@@ -728,11 +719,10 @@ public class AuthoringWebService extends AbstractWebService implements
{ {
try try
{ {
TransactionUtil.executeInUserTransaction( transactionService.getRetryingTransactionHelper().doInTransaction(
this.transactionService, new RetryingTransactionCallback<Object>()
new TransactionUtil.TransactionWork()
{ {
public Object doWork() public Object execute()
{ {
NodeRef nodeRef = Utils.convertToNodeRef( NodeRef nodeRef = Utils.convertToNodeRef(
node, node,
@@ -781,11 +771,10 @@ public class AuthoringWebService extends AbstractWebService implements
{ {
try try
{ {
return TransactionUtil.executeInUserTransaction( return transactionService.getRetryingTransactionHelper().doInTransaction(
this.transactionService, new RetryingTransactionCallback<VersionHistory>()
new TransactionUtil.TransactionWork<VersionHistory>()
{ {
public VersionHistory doWork() public VersionHistory execute()
{ {
NodeRef nodeRef = Utils.convertToNodeRef( NodeRef nodeRef = Utils.convertToNodeRef(
node, node,

View File

@@ -31,7 +31,7 @@ import java.util.List;
import java.util.Set; import java.util.Set;
import org.alfresco.model.ContentModel; 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.AbstractWebService;
import org.alfresco.repo.webservice.Utils; import org.alfresco.repo.webservice.Utils;
import org.alfresco.repo.webservice.types.Category; import org.alfresco.repo.webservice.types.Category;
@@ -117,11 +117,10 @@ public class ClassificationWebService extends AbstractWebService implements
{ {
try try
{ {
return TransactionUtil.executeInUserTransaction( return transactionService.getRetryingTransactionHelper().doInTransaction(
this.transactionService, new RetryingTransactionCallback<Classification[]>()
new TransactionUtil.TransactionWork<Classification[]>()
{ {
public Classification[] doWork() public Classification[] execute()
{ {
List<Classification> classifications = new ArrayList<Classification>(); List<Classification> classifications = new ArrayList<Classification>();
@@ -198,11 +197,10 @@ public class ClassificationWebService extends AbstractWebService implements
{ {
try try
{ {
return TransactionUtil.executeInUserTransaction( return transactionService.getRetryingTransactionHelper().doInTransaction(
this.transactionService, new RetryingTransactionCallback<Category[]>()
new TransactionUtil.TransactionWork<Category[]>()
{ {
public Category[] doWork() public Category[] execute()
{ {
NodeRef parentNodeRef = Utils.convertToNodeRef( NodeRef parentNodeRef = Utils.convertToNodeRef(
parentCategory, parentCategory,
@@ -246,11 +244,10 @@ public class ClassificationWebService extends AbstractWebService implements
{ {
try try
{ {
return TransactionUtil.executeInUserTransaction( return transactionService.getRetryingTransactionHelper().doInTransaction(
this.transactionService, new RetryingTransactionCallback<CategoriesResult[]>()
new TransactionUtil.TransactionWork<CategoriesResult[]>()
{ {
public CategoriesResult[] doWork() public CategoriesResult[] execute()
{ {
List<CategoriesResult> result = new ArrayList<CategoriesResult>(); List<CategoriesResult> result = new ArrayList<CategoriesResult>();
@@ -354,11 +351,10 @@ public class ClassificationWebService extends AbstractWebService implements
{ {
try try
{ {
return TransactionUtil.executeInUserTransaction( return transactionService.getRetryingTransactionHelper().doInTransaction(
this.transactionService, new RetryingTransactionCallback<CategoriesResult[]>()
new TransactionUtil.TransactionWork<CategoriesResult[]>()
{ {
public CategoriesResult[] doWork() public CategoriesResult[] execute()
{ {
List<CategoriesResult> result = new ArrayList<CategoriesResult>(); List<CategoriesResult> result = new ArrayList<CategoriesResult>();
@@ -437,11 +433,10 @@ public class ClassificationWebService extends AbstractWebService implements
{ {
try try
{ {
return TransactionUtil.executeInUserTransaction( return transactionService.getRetryingTransactionHelper().doInTransaction(
this.transactionService, new RetryingTransactionCallback<ClassDefinition>()
new TransactionUtil.TransactionWork<ClassDefinition>()
{ {
public ClassDefinition doWork() public ClassDefinition execute()
{ {
org.alfresco.service.cmr.dictionary.ClassDefinition classDefinition = ClassificationWebService.this.dictionaryService.getClass(QName.createQName(classification)); org.alfresco.service.cmr.dictionary.ClassDefinition classDefinition = ClassificationWebService.this.dictionaryService.getClass(QName.createQName(classification));
return Utils.setupClassDefObject(classDefinition); return Utils.setupClassDefObject(classDefinition);