mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +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:
@@ -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<ACL[]>()
|
||||
RetryingTransactionCallback<ACL[]> callback = new RetryingTransactionCallback<ACL[]>()
|
||||
{
|
||||
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<ACL[]>()
|
||||
RetryingTransactionCallback<ACL[]> callback = new RetryingTransactionCallback<ACL[]>()
|
||||
{
|
||||
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<ACL[]>()
|
||||
RetryingTransactionCallback<ACL[]> callback = new RetryingTransactionCallback<ACL[]>()
|
||||
{
|
||||
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<GetPermissionsResult[]>()
|
||||
RetryingTransactionCallback<GetPermissionsResult[]> callback = new RetryingTransactionCallback<GetPermissionsResult[]>()
|
||||
{
|
||||
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<GetClassPermissionsResult[]>()
|
||||
RetryingTransactionCallback<GetClassPermissionsResult[]> callback = new RetryingTransactionCallback<GetClassPermissionsResult[]>()
|
||||
{
|
||||
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<HasPermissionsResult[]>()
|
||||
RetryingTransactionCallback<HasPermissionsResult[]> callback = new RetryingTransactionCallback<HasPermissionsResult[]>()
|
||||
{
|
||||
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<ACL[]>()
|
||||
RetryingTransactionCallback<ACL[]> callback = new RetryingTransactionCallback<ACL[]>()
|
||||
{
|
||||
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<OwnerResult[]>()
|
||||
RetryingTransactionCallback<OwnerResult[]> callback = new RetryingTransactionCallback<OwnerResult[]>()
|
||||
{
|
||||
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<OwnerResult[]>()
|
||||
RetryingTransactionCallback<OwnerResult[]> callback = new RetryingTransactionCallback<OwnerResult[]>()
|
||||
{
|
||||
public OwnerResult[] doWork() throws Exception
|
||||
public OwnerResult[] execute() throws Exception
|
||||
{
|
||||
return setOwnersImpl(predicate, owner);
|
||||
}
|
||||
});
|
||||
};
|
||||
return transactionService.getRetryingTransactionHelper().doInTransaction(callback);
|
||||
}
|
||||
catch (Throwable exception)
|
||||
{
|
||||
|
@@ -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<ActionItemDefinition[]>()
|
||||
RetryingTransactionCallback<ActionItemDefinition[]> callback = new RetryingTransactionCallback<ActionItemDefinition[]>()
|
||||
{
|
||||
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<ActionItemDefinition[]>()
|
||||
RetryingTransactionCallback<ActionItemDefinition[]> callback = new RetryingTransactionCallback<ActionItemDefinition[]>()
|
||||
{
|
||||
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<ActionItemDefinition>()
|
||||
RetryingTransactionCallback<ActionItemDefinition> callback = new RetryingTransactionCallback<ActionItemDefinition>()
|
||||
{
|
||||
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<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 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<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 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<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 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<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 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<Object>()
|
||||
RetryingTransactionCallback<Object> callback = new RetryingTransactionCallback<Object>()
|
||||
{
|
||||
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<ActionExecutionResult[]>()
|
||||
RetryingTransactionCallback<ActionExecutionResult[]> callback = new RetryingTransactionCallback<ActionExecutionResult[]>()
|
||||
{
|
||||
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<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 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<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 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<Object>()
|
||||
RetryingTransactionCallback<Object> callback = new RetryingTransactionCallback<Object>()
|
||||
{
|
||||
public Object doWork() throws Exception
|
||||
public Object execute() throws Exception
|
||||
{
|
||||
removeRulesImpl(reference, webServiceRules);
|
||||
return null;
|
||||
}
|
||||
});
|
||||
};
|
||||
transactionService.getRetryingTransactionHelper().doInTransaction(callback);
|
||||
}
|
||||
catch (Throwable exception)
|
||||
{
|
||||
|
@@ -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<UserQueryResults>()
|
||||
RetryingTransactionCallback<UserQueryResults> callback = new RetryingTransactionCallback<UserQueryResults>()
|
||||
{
|
||||
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<UserQueryResults>()
|
||||
RetryingTransactionCallback<UserQueryResults> callback = new RetryingTransactionCallback<UserQueryResults>()
|
||||
{
|
||||
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<UserDetails>()
|
||||
RetryingTransactionCallback<UserDetails> callback = new RetryingTransactionCallback<UserDetails>()
|
||||
{
|
||||
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<UserDetails[]>()
|
||||
RetryingTransactionCallback<UserDetails[]> callback = new RetryingTransactionCallback<UserDetails[]>()
|
||||
{
|
||||
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<UserDetails[]>()
|
||||
RetryingTransactionCallback<UserDetails[]> callback = new RetryingTransactionCallback<UserDetails[]>()
|
||||
{
|
||||
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<Object>()
|
||||
RetryingTransactionCallback<Object> callback = new RetryingTransactionCallback<Object>()
|
||||
{
|
||||
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<Object>()
|
||||
RetryingTransactionCallback<Object> callback = new RetryingTransactionCallback<Object>()
|
||||
{
|
||||
public Object doWork() throws Exception
|
||||
public Object execute() throws Exception
|
||||
{
|
||||
deleteUsersImpl(userNames);
|
||||
return null;
|
||||
}
|
||||
});
|
||||
};
|
||||
transactionService.getRetryingTransactionHelper().doInTransaction(callback);
|
||||
}
|
||||
catch (Throwable exception)
|
||||
{
|
||||
|
@@ -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<CheckoutResult>()
|
||||
return transactionService.getRetryingTransactionHelper().doInTransaction(
|
||||
new RetryingTransactionCallback<CheckoutResult>()
|
||||
{
|
||||
public CheckoutResult doWork()
|
||||
public CheckoutResult execute()
|
||||
{
|
||||
List<NodeRef> 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<CheckinResult>()
|
||||
return transactionService.getRetryingTransactionHelper().doInTransaction(
|
||||
new RetryingTransactionCallback<CheckinResult>()
|
||||
{
|
||||
public CheckinResult doWork()
|
||||
public CheckinResult execute()
|
||||
{
|
||||
// Get the passed nodes
|
||||
List<NodeRef> nodes = Utils.resolvePredicate(
|
||||
@@ -301,11 +299,10 @@ public class AuthoringWebService extends AbstractWebService implements
|
||||
{
|
||||
try
|
||||
{
|
||||
return TransactionUtil.executeInUserTransaction(
|
||||
this.transactionService,
|
||||
new TransactionUtil.TransactionWork<Reference>()
|
||||
return transactionService.getRetryingTransactionHelper().doInTransaction(
|
||||
new RetryingTransactionCallback<Reference>()
|
||||
{
|
||||
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<CancelCheckoutResult>()
|
||||
return transactionService.getRetryingTransactionHelper().doInTransaction(
|
||||
new RetryingTransactionCallback<CancelCheckoutResult>()
|
||||
{
|
||||
public CancelCheckoutResult doWork()
|
||||
public CancelCheckoutResult execute()
|
||||
{
|
||||
// Get the passed nodes
|
||||
List<NodeRef> nodes = Utils.resolvePredicate(
|
||||
@@ -421,11 +417,10 @@ public class AuthoringWebService extends AbstractWebService implements
|
||||
{
|
||||
try
|
||||
{
|
||||
return TransactionUtil.executeInUserTransaction(
|
||||
this.transactionService,
|
||||
new TransactionUtil.TransactionWork<Reference[]>()
|
||||
return transactionService.getRetryingTransactionHelper().doInTransaction(
|
||||
new RetryingTransactionCallback<Reference[]>()
|
||||
{
|
||||
public Reference[] doWork()
|
||||
public Reference[] execute()
|
||||
{
|
||||
// Get the passed nodes
|
||||
List<NodeRef> nodes = Utils.resolvePredicate(
|
||||
@@ -489,11 +484,10 @@ public class AuthoringWebService extends AbstractWebService implements
|
||||
{
|
||||
try
|
||||
{
|
||||
return TransactionUtil.executeInUserTransaction(
|
||||
this.transactionService,
|
||||
new TransactionUtil.TransactionWork<Reference[]>()
|
||||
return transactionService.getRetryingTransactionHelper().doInTransaction(
|
||||
new RetryingTransactionCallback<Reference[]>()
|
||||
{
|
||||
public Reference[] doWork()
|
||||
public Reference[] execute()
|
||||
{
|
||||
// Get the passed nodes
|
||||
List<NodeRef> nodes = Utils.resolvePredicate(
|
||||
@@ -536,11 +530,10 @@ public class AuthoringWebService extends AbstractWebService implements
|
||||
{
|
||||
try
|
||||
{
|
||||
return TransactionUtil.executeInUserTransaction(
|
||||
this.transactionService,
|
||||
new TransactionUtil.TransactionWork<LockStatus[]>()
|
||||
return transactionService.getRetryingTransactionHelper().doInTransaction(
|
||||
new RetryingTransactionCallback<LockStatus[]>()
|
||||
{
|
||||
public LockStatus[] doWork()
|
||||
public LockStatus[] execute()
|
||||
{
|
||||
// Get the passed nodes
|
||||
List<NodeRef> nodes = Utils.resolvePredicate(
|
||||
@@ -613,11 +606,10 @@ public class AuthoringWebService extends AbstractWebService implements
|
||||
{
|
||||
try
|
||||
{
|
||||
return TransactionUtil.executeInUserTransaction(
|
||||
this.transactionService,
|
||||
new TransactionUtil.TransactionWork<VersionResult>()
|
||||
return transactionService.getRetryingTransactionHelper().doInTransaction(
|
||||
new RetryingTransactionCallback<VersionResult>()
|
||||
{
|
||||
public VersionResult doWork()
|
||||
public VersionResult execute()
|
||||
{
|
||||
// Get the passed nodes
|
||||
List<NodeRef> nodes = Utils.resolvePredicate(
|
||||
@@ -675,11 +667,10 @@ public class AuthoringWebService extends AbstractWebService implements
|
||||
{
|
||||
try
|
||||
{
|
||||
return TransactionUtil.executeInUserTransaction(
|
||||
this.transactionService,
|
||||
new TransactionUtil.TransactionWork<VersionHistory>()
|
||||
return transactionService.getRetryingTransactionHelper().doInTransaction(
|
||||
new RetryingTransactionCallback<VersionHistory>()
|
||||
{
|
||||
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<Object>()
|
||||
{
|
||||
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<VersionHistory>()
|
||||
return transactionService.getRetryingTransactionHelper().doInTransaction(
|
||||
new RetryingTransactionCallback<VersionHistory>()
|
||||
{
|
||||
public VersionHistory doWork()
|
||||
public VersionHistory execute()
|
||||
{
|
||||
NodeRef nodeRef = Utils.convertToNodeRef(
|
||||
node,
|
||||
|
@@ -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<Classification[]>()
|
||||
return transactionService.getRetryingTransactionHelper().doInTransaction(
|
||||
new RetryingTransactionCallback<Classification[]>()
|
||||
{
|
||||
public Classification[] doWork()
|
||||
public Classification[] execute()
|
||||
{
|
||||
List<Classification> classifications = new ArrayList<Classification>();
|
||||
|
||||
@@ -198,11 +197,10 @@ public class ClassificationWebService extends AbstractWebService implements
|
||||
{
|
||||
try
|
||||
{
|
||||
return TransactionUtil.executeInUserTransaction(
|
||||
this.transactionService,
|
||||
new TransactionUtil.TransactionWork<Category[]>()
|
||||
return transactionService.getRetryingTransactionHelper().doInTransaction(
|
||||
new RetryingTransactionCallback<Category[]>()
|
||||
{
|
||||
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<CategoriesResult[]>()
|
||||
return transactionService.getRetryingTransactionHelper().doInTransaction(
|
||||
new RetryingTransactionCallback<CategoriesResult[]>()
|
||||
{
|
||||
public CategoriesResult[] doWork()
|
||||
public CategoriesResult[] execute()
|
||||
{
|
||||
List<CategoriesResult> result = new ArrayList<CategoriesResult>();
|
||||
|
||||
@@ -354,11 +351,10 @@ public class ClassificationWebService extends AbstractWebService implements
|
||||
{
|
||||
try
|
||||
{
|
||||
return TransactionUtil.executeInUserTransaction(
|
||||
this.transactionService,
|
||||
new TransactionUtil.TransactionWork<CategoriesResult[]>()
|
||||
return transactionService.getRetryingTransactionHelper().doInTransaction(
|
||||
new RetryingTransactionCallback<CategoriesResult[]>()
|
||||
{
|
||||
public CategoriesResult[] doWork()
|
||||
public CategoriesResult[] execute()
|
||||
{
|
||||
List<CategoriesResult> result = new ArrayList<CategoriesResult>();
|
||||
|
||||
@@ -437,11 +433,10 @@ public class ClassificationWebService extends AbstractWebService implements
|
||||
{
|
||||
try
|
||||
{
|
||||
return TransactionUtil.executeInUserTransaction(
|
||||
this.transactionService,
|
||||
new TransactionUtil.TransactionWork<ClassDefinition>()
|
||||
return transactionService.getRetryingTransactionHelper().doInTransaction(
|
||||
new RetryingTransactionCallback<ClassDefinition>()
|
||||
{
|
||||
public ClassDefinition doWork()
|
||||
public ClassDefinition execute()
|
||||
{
|
||||
org.alfresco.service.cmr.dictionary.ClassDefinition classDefinition = ClassificationWebService.this.dictionaryService.getClass(QName.createQName(classification));
|
||||
return Utils.setupClassDefObject(classDefinition);
|
||||
|
Reference in New Issue
Block a user