Announcement Announcement Module
Collapse
No announcement yet.
Doubt with skipping during item writing in Spring Batch Program Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Doubt with skipping during item writing in Spring Batch Program

    Hello All,

    Spring documentation (Pg. 46, Section: 5.1.7) says:

    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.
    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.

    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".

    Thanks,
    Nikunj

  • #2
    32 views 0 replies

    Hello All,

    Can anyone please attempt my query!!

    Thanks in advance!!
    Nikunj

    Comment

    Working...
    X