Open spring-projects-issues opened 11 years ago
Thank you for opening the issue. Can you retry with the latest release of Spring Batch(5.0.2) and report back the results?
If the issue is reproducible, can you provide a sample project that uses the latest release of Spring Batch and that exhibits the behavior? To help you in reporting your issue, we have prepared a project template that you can use as a starting point. Please check the Issue Reporting Guidelines for more details about this.
Krishna Bhamidipati opened BATCH-2107 and commented
Spring Batch 2.1.8 introduced the
@BeforeStep
and@AfterStep
annotations, in lieu of implementing StepExecutionListener.If a class:
@BeforeStep
/@AfterStep
annotationsHowever, if the class is not step scope, then the the beforeStep/afterStep run only once, as expected.
The attached project has a JUnit test (ExampleJobConfigurationTests) that demonstrates the above behavior. writer1 is step scope and writer2 is not. The console output reveals writer1's beforeStep and afterStep run twice whereas writer2's run only once.
Affects: 2.1.8, 2.1.9, 2.2.0, 2.2.1, 2.2.2
Attachments:
1 votes, 2 watchers