java - commit-interval is not working as expected -
let say,we have 1000 items in db,and try fetch , delete 10 items,at time.for have implemented spring batch.
as per below configuration.
<batch:chunk reader="tokenreader" writer="tokenwriter" commit-interval="10"></batch:chunk> we have itemreader class,which fetch 10 item @ time db , passes list of 10 token itemwriter.
so after processing 10 items,it should commit ideally.
but facing below issue.
with commit-interval = 10,joblauncher launching 10 threads,and each thread fetching same 10 tokens database,and once itemreader passes list of 10 token itemwriter,we receive exception("the token marked deleted" jpa exception).
however if set commit-interval = 1,it starts 1 thread , execute fetch , delete 10 items @ time.
Comments
Post a Comment