Announcement Announcement Module
No announcement yet.
commit-interval in the code Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • commit-interval in the code


    I am not sure how to do this in cleaner style:

    I have a list of recordId that I retrieve from a table in local db. Then with each record I want to perform number of queries to a remote db and persist result in local tables (different form the one I read the list initially). Each query is executed in a seperate step with own reader and writer.

    I defined a completion policy to iterrate over the list or retrieved records and supply single id to a step. So this prevents me to use commit-interval in the code as I don't want to wait all the record Ids to be passed and then the data to be flushed. I want to do commit after the last step for each recordId passed.

  • #2
    i believe it is already there , there is no need to commit in last step , it will be taken care by spring batch once your job will be completed successfully only, else transaction will be rolled back as you avoided commit interval so no chunk processing so no multiple transaction boundaries.