In a Spring Batch Job I am writing the item to target file (using FlatFileItemWriter) and updating input record "process indicator" field as "processed"/"failed" (using JdbcBatchItemWriter). Which is the best way to make this happen in a "item transaction" ?
The recommended way is to use the ChunkListener#afterChunk to update a flag like that. This allows it to be separate from any retry, etc logic that gets involved in the other two options you proposed.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With