From ab7e4f814f5170338487804d86a855a7fac234e5 Mon Sep 17 00:00:00 2001 From: dsyer Date: Fri, 13 Jun 2008 10:21:28 +0000 Subject: [PATCH] Re-order status update and listener execution --- .../java/org/springframework/batch/core/step/AbstractStep.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/step/AbstractStep.java b/spring-batch-core/src/main/java/org/springframework/batch/core/step/AbstractStep.java index 5df121a7b..23a54beda 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/step/AbstractStep.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/step/AbstractStep.java @@ -166,11 +166,12 @@ public abstract class AbstractStep implements Step, InitializingBean, BeanNameAw throw new UnexpectedJobExecutionException("Failed to initialize the step", e); } exitStatus = doExecute(stepExecution); + + stepExecution.setStatus(BatchStatus.COMPLETED); exitStatus = exitStatus.and(getCompositeListener().afterStep(stepExecution)); try { getJobRepository().saveOrUpdateExecutionContext(stepExecution); - stepExecution.setStatus(BatchStatus.COMPLETED); } catch (Exception e) { commitException = e;