Comments (6)
Thanks for your feedback. Section 11.8 Chunk with Listeners of the spec v1.0 Maintenance Release covers your use case in general with detailed flows.
A chunk-type step consists of multiple chunks, and ChunkListener is for these smaller chunks, not for the entire step. When ItemReader.open() is called at the beginning of the step, we haven't come to any chunk yet, why should the ChunkListener be called?
Both javax.batch.api.chunk.listener.ChunkListener#beforeChunk and afterChunk javadoc says that "This method is invoked in the same transaction as the chunk processing." So I would assume the same would apply to onError to mean that chunk transaction here refers to the actual unit of work of chunk processing.
from jsr352.
You may want to present your issue to batch spec group discussion for more perspectives and suggestions:
https://java.net/projects/jbatch/lists/public/archive
from jsr352.
Bug 4548 - Add onError to ChunkListener provides some background:
https://java.net/bugzilla/show_bug.cgi?id=4548
from jsr352.
Thanks for your explanations and for providing further links/information. I agree with your point of view concerning the call of the ChunkListener.onError() method. I will open a ticket for BatchEE accordingly.
BTW, I think that there is a similar topic concerning the error-processing on step-level. As far as I have seen, JBeret does not call the StepListener.afterStep() method, if an exception is thrown during the step-processing. In the JBatch RI / BatchEE, it seems that the afterStep() method is called even if an exception occurred inside the step. This applies to Chunk- and Batchlet-Steps. The spec also is not very clear about this topic:
The afterStep method receives control after a step execution ends.
Following the logic of ChunkListener.afterChunk(), the afterStep() method should not be called in case of exceptions. But again, this makes it impossible to implement some generic error-processing in form of listeners on step-level.
From my point of view, a top-level error-handling for steps would be great (e.g. in form of a StepListener.onError() method). This would cover exceptions during batchlet-processing as well as exceptions inside chunk-steps, which occur outside of the single chunks (e.g. in the open() and close() methods). I will present this topic for discussion on the spec mailing list together with the original issue. Thanks for your help so far.
from jsr352.
Sounds good. Let's continue the discussion on batch spec list.
from jsr352.
batch spec discussion:
https://java.net/projects/jbatch/lists/public/archive/2014-12/message/3
from jsr352.
Related Issues (20)
- gulp build doesn't exit HOT 4
- NoSuchJobException HOT 8
- Need to update the link to JSR 352 spec project in README.md HOT 1
- If the server is using other timezone the JDBC repository will show wrong time. HOT 7
- According JBeret specification JBeret should be able to @Inject @BatchProperty File file, but it works only in special curcumstance. HOT 2
- Checkpoints must be set after skipped item HOT 5
- JBERET000640 - Wildfly 14 HOT 13
- Does JBeret support Java11? HOT 3
- Usage of JBoss Marshalling incompatible with native compilation with GraalVM HOT 8
- Jberet and Thorntail HOT 2
- Inconsistent BatchStatus after database connection loss HOT 1
- Support additional Serialization mechanisms
- jberet-camel reading only one file HOT 2
- Mongo support for storing batch metadata? HOT 2
- PurgeBatchlet doesn't work with JdbcJobRepository HOT 2
- "JBERET000651: The requested permits (%d) is greater than the maximum number of permits (%d) allowed in the thread pool."; HOT 2
- user guide HOT 2
- Support Java 17 HOT 10
- Injection of batch artifact properties does not work HOT 10
- Job versioning does not appear to be supported in JBeret HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jsr352.