Results 1 to 4 of 4

Thread: Understanding SkipListener

  1. #1

    Default 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. #2
    Join Date
    Feb 2008
    Posts
    488

    Default

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

  3. #3

    Default

    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!

  4. #4
    Join Date
    Feb 2008
    Posts
    488

    Default

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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •