04-20-2010 07:32 AM
synchronized public void injectIdentifier(NodeRef nodeRef) {
NodeRef rootSpace = locateRootSpace();
Action countAction = serviceRegistry.getActionService().createAction("counter");
serviceRegistry.getActionService().executeAction(countAction, rootSpace);
Integer count = (Integer) nodeService.getProperty(arubaHome, ContentModel.PROP_COUNTER);
count += 9999;
nodeService.setProperty(nodeRef, MyModel.PROP_IDENTIFIER, count.toString());
}
04-21-2010 04:46 PM
04-22-2010 04:14 AM
serviceRegistry.getTransactionService().getRetryingTransactionHelper().doInTransaction(new RetryingTransactionCallback<Boolean>() {
@Override
public Boolean execute() throws Throwable {
// code called here
return true;
}
}, false, true);
04-22-2010 05:35 AM
start new transaction (as you did in your last post)
call injectIdentifier(NodeRef nodeRef);
Integer nextCount = call counterBean.nextCount();
start new, non-propagating transaction IFF you don't mind holes in the counter sequence (I'd suggest this for better concurrency)
Get the value from the root space, increment it, set it and return the new value
Set the property on your nodeRef (the folder that you're unzipping to, I presume)
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.