Spring documentation (Pg. 46, Section: 5.1.7) says:
My commit interval is set to 10. So my understanding of above paragraph is, if their is error in writing 7th record out of the chunk of 10 during read, the item will be skipped and the correct 9 records will be sent ahead by itemReader. However, if the 7th record is in error during writing - none of the 10 records will be written and a rollback will happen.By default, regardless of retry or skip, any exceptions thrown from the ItemWriter will cause the transaction controlled by the Step to rollback. If skip is configured as described above, exceptions thrown from the ItemReader will not cause a rollback.
However, when I am including the error in my skipPolicy, itemWriter IS writing the remaining 9 records to the database skipping the errored one. This is contradictory to what is mentioned above.
Can any one please explain the concept of "skip during item writing".