Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Invalid
-
0.1-incubating, 0.2-incubating, 0.3-incubating
-
None
Description
Note: This issue is somehow related to
https://issues.apache.org/jira/browse/BATCHEE-56
As we have some integration-tests running on different application-servers, we discovered some differences in the behavior of the jbatch-implementations concerning listeners in case of exceptions:
If an exception occurs during step-processing (Batchlet- as well as Chunk-Steps), then in case of JBeret, the StepListener.afterStep() method is not called, while the JBatch RI included in GlassFish 4 as well as Apache BatchEE do call the method.
This issue has already been discussed in the JBeret issue-tracker:
https://github.com/jberet/jsr352/issues/25
Following the logic of the ChunkListener.afterChunk() method, I think that the afterStep()-method should not be called in case of exceptions. So I think the BatchEE implementation should be adjusted here. Please refer to the JBeret issue linked above for more details.
I think in case of exceptions, something like a StepListener.onError() method would be a good idea (instead of calling afterStep() ). I have opened a discussion on the jbatch public mailing list for enhancing the error-handling with listeners:
https://java.net/projects/jbatch/lists/public/archive/2014-12/message/3