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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user