Skip to content

Commit

Permalink
Check dirty flag of step execution context before update in inner loop
Browse files Browse the repository at this point in the history
  • Loading branch information
hpoettker authored and fmbenhassine committed Feb 12, 2024
1 parent aa60824 commit 74520a5
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,9 @@ public RepeatStatus doInTransaction(TransactionStatus status) {
try {
// Going to attempt a commit. If it fails this flag will
// stay false and we can use that later.
getJobRepository().updateExecutionContext(stepExecution);
if (stepExecution.getExecutionContext().isDirty()) {
getJobRepository().updateExecutionContext(stepExecution);
}
stepExecution.incrementCommitCount();
if (logger.isDebugEnabled()) {
logger.debug("Saving step execution before commit: " + stepExecution);
Expand Down

0 comments on commit 74520a5

Please sign in to comment.