Skip to content

Fix for BATCH-1767 #214

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -392,11 +392,6 @@ public Object doInTransaction(TransactionStatus status) {

chunkListener.beforeChunk(chunkContext);

// In case we need to push it back to its old value
// after a commit fails...
oldVersion = new StepExecution(stepExecution.getStepName(), stepExecution.getJobExecution());
copy(stepExecution, oldVersion);

try {

try {
Expand All @@ -422,6 +417,13 @@ public Object doInTransaction(TransactionStatus status) {
try {
semaphore.acquire();
locked = true;
// In case we need to push it back to its old value
// after a commit fails...
// Here we are sure we get the most up to date version since
// semaphore acquisition garantees that no other thread has modified it
oldVersion = new StepExecution(stepExecution.getStepName(), stepExecution.getJobExecution());
copy(stepExecution, oldVersion);

}
catch (InterruptedException e) {
logger.error("Thread interrupted while locking for repository update");
Expand Down