Say my commit interval is 1000.
And during writing I get a error at 990th record which is skippable as per skip policy.
So a rollback will occur and the wr
that bevaviour is mandatory for spring batch to isolate the bad item(s), basically it rollbacks the chunk and processes/writes each item with commit-rate=1 to find the bad one (in either processor or writer)
see spring batch forum comment to similar problem
the relevant part
--> 5 items read, processing starts
will throw an error on write
--> error on item 17, but it was in the list, lets find it
--> rollback
--> spring batch goes through all items of the chunk again to find the bad item
--> basically it runs now with commit-rate="1" (only for this chunk)
called again for the bad item, because it's still unknown to spring batch, that this is the bad one
--> no write, because itemWriter.write() was called with the bad item only and did throw an exception (again)
--> but now spring batch knows the bad item