I saw this spring batch not processing all records
I have the same setup where-in I read records:
Example with page size = 2 and 6 lines in db
A IS_UPDATED=true
B IS_UPDATED=true
C IS_UPDATED=true
D IS_UPDATED=true
E IS_UPDATED=true
F IS_UPDATED=true
The problem is probably mixing pagination and updating the reader query's criteria (IS_UPDATED).
Example with page size = 2 and 6 lines in db
A IS_UPDATED=true
B IS_UPDATED=true
C IS_UPDATED=true
D IS_UPDATED=true
E IS_UPDATED=true
F IS_UPDATED=true
First read page = 1 return lines A and B
After writer execution (set IS_UPDATED to false for A & B), we have in db :
C IS_UPDATED=true
D IS_UPDATED=true
E IS_UPDATED=true
F IS_UPDATED=true
Second read will move to page 2 so it will take lines E & F and not C & D
I was thinking of what alternative approach for this since IS_UPDATED = true is my itemReader criteria and identifier. If I leave IS_UPDATED to true, then it will always be included on my daily batch app.
Addendum: I am using this for multi-threading
@Bean
public TaskExecutor taskExecutor() {
return new SimpleAsyncTaskExecutor("taskName");
}