Improve Documentation if an ItemWriter is used with a Database connection #4378
Labels
status: declined
Features that we don't intend to implement or Bug reports that are invalid or missing enough details
Hi
I have asked a Question https://stackoverflow.com/questions/76073523/spring-batch-with-faulttolerant-config-swallow-sql-exception-on-commit-of-a-item/76099432
Here is the same info again:
We make heavy use of Spring Batch (5.0.1) in our new Project (SpringBoot 3.0.5) and MS Sql Server. We like to use the "faultTolerant" feature. eg:
Up to now, everything works fine. Now we have found a case where we process data in the ItemWriter that are not ok. Some data is too long for the DB field. We use JPA and do no flush.
My expectation would be, on an error, the Step stops with an exception. But this does not happen, it continues the Job. It also rollback my Business transaction.😱😱😱
For use, it looks like everything worked correct, but we just missed some data. 😱😱😱
If i add a
flush()
with the entitymanager, i see the exception and Spring Batch behaves as expected and stops the Job.If i change the Step to this, it also works correct (stop the Job):
I found two entries that could explain the problem:
#1189
#3950
What do i wrong? Is the Spring Batch faultTolerant broken?
I think the Documentation should be improved, telling you to flush when you use a DB connection without a correct Writer.
If possible Spring Batch should stop processing when this error occur:
The text was updated successfully, but these errors were encountered: