Mar 6th, 2013, 06:59 AM
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.
Mar 7th, 2013, 12:45 AM
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.
Tags for this Thread