Announcement Announcement Module
Collapse
No announcement yet.
Understanding SkipListener Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Understanding SkipListener

    Hello Everyone,

    I am using FlatFileItemReader and loading the records into database. I also added the SkipListener to handle write errors. I found following during testing.

    The File have 55 records and while loading 55th record into database I had an exception and it was skipped.

    I noticed following in the BATCH_STEP_EXECUTION table.

    READ_COUNT: 55
    WRITE_COUNT: 108
    WRITE_SKIP_COUNT: 1
    ROLLBACK_COUNT: 2
    COMMIT_COUNT: 1 (My commit interval is 100)

    Here READ_COUNT and WRITE_SKIP_COUNT are accurate. But I do not understand WRITE_COUNT and ROLLBACK_COUNT.

    Database was correctly loaded with 54 records. But WRITE_COUNT and ROLLBACK_COUNT are misleading.
    Can someone please explain?

  • #2
    I agree. I have created the following issue to investigate further:
    http://jira.springframework.org/browse/BATCH-1128

    Comment


    • #3
      Per Section 5.1.8 in UserGuide, the Step can be configured with a list of exceptions that should not cause rollback. So I added following transaction-attribute to my step:


      Code:
      transaction-attribute="+org.springframework.dao.DataIntegrityViolationException"
      But this is still causing rollbacks.

      Thanks for all your help!

      Comment


      • #4
        An issue has been created to track this: http://jira.springframework.org/browse/BATCH-1129

        Comment

        Working...
        X