Results 1 to 3 of 3

Thread: commit interval

  1. #1
    Join Date
    Dec 2010
    Posts
    4

    Default commit interval

    Hi,

    I understand spring batch 2 allows chunk read and only call writer once at end of the chunk.

    If I set commit interval of my tasklet to 5, that means spring batch will divide the input dataload into 5 groups, and call the reader 5 times and only call writer once at the end of step?

    The reason why I am asking this question is that I want to create a zip file to include all the input read in itemwriter. I don't want to create multiple zip files.

    Please help. thanks!

  2. #2

    Default

    Each call to reader gives 1 item.

    Each call to processor takes 1 item and returns 1 item.

    Each call to writer takes 1 "batch" of items, depending on your batch size (1, 1000, whatever).

    If you want your writer to do the entire file at once, then you just need an item writer that keeps streaming the stuff to your zip file on disk until you are done.

  3. #3
    Join Date
    Dec 2005
    Posts
    17

    Default Write entire chunk once

    Hi, we have a similar requirement where we read a bunch of records, process them one by one, but would like to write all of them at once. We are using Spring Batch 2.1.7 and commit-interval seems to be a mandatory parameter.

    Could you please let us know how this could be achieved in Spring Batch?

    Thanks,
    Ramesh Javvaji

Posting Permissions

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