OPEN - issue BATCH-170: Concurrent modification of StepExecution when running an asynchrounous step operation

http://opensource.atlassian.com/projects/spring/browse/BATCH-170

Synchronized and added OptimisticLockingException to SqlStepDao.  The parallel job now runs cleanly (tried it a few times).
This commit is contained in:
dsyer
2007-12-19 13:06:31 +00:00
parent 7f71dc55ce
commit 37696b45f4
21 changed files with 431 additions and 297 deletions

View File

@@ -75,7 +75,9 @@ public class StagingItemReader extends JdbcDaoSupport implements
Assert.state(keys == null || initialized,
"Cannot open an already open StagingItemProvider"
+ ", call close() first.");
keys = retrieveKeys().iterator();
synchronized (lock) {
keys = retrieveKeys().iterator();
}
logger.info("keys: " + keys);
registerSynchronization();
initialized = true;
@@ -147,7 +149,7 @@ public class StagingItemReader extends JdbcDaoSupport implements
throw new OptimisticLockingFailureException(
"The staging record with ID="
+ id
+ " was updated concurrently when trying to mark as complete.");
+ " was updated concurrently when trying to mark as complete (updated "+count+" records.");
}
return result;
}