ALF-3262 - Avoid contention and auth issues when updating the last run details on a previously persisted action run through the action tracking service

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@22917 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Nick Burch
2010-10-06 12:33:11 +00:00
parent ae2ee867f1
commit 28dcad6dba
2 changed files with 61 additions and 2 deletions

View File

@@ -667,11 +667,18 @@ public class ActionTrackingServiceImplTest extends TestCase
3, actionTrackingService.getExecutingActions(sa13).size()
);
// Let the update change the stored node
UserTransaction txn = transactionService.getUserTransaction();
txn.begin();
actionTrackingService.recordActionComplete(sa13);
actionTrackingService.recordActionComplete(moveAction);
txn.commit();
Thread.sleep(50);
// Check
assertEquals(
2, actionTrackingService.getAllExecutingActions().size()
);
@@ -863,6 +870,12 @@ public class ActionTrackingServiceImplTest extends TestCase
assertNull(action.getExecutionFailureMessage());
assertEquals(ActionStatus.Completed, action.getExecutionStatus());
// Let the update change the stored node
txn.commit();
txn = transactionService.getUserTransaction();
txn.begin();
Thread.sleep(50);
// Now re-load and check the stored one
action = runtimeActionService.createAction(actionNode);
assertNotNull(action.getExecutionStartDate());