Good day,
I have a Spring batch that using different step, the Job is something like follow:
@Bean
public Job myJob() throws Exception {
return jobBuilderFactory.get("MyJob").repository(batchConfiguration.jobRepository())
.start(step1()).next(step2()).build();
}
In my step1()
,it has its own reader, processor, and writer, in this writer, I will update table A.
And then in my step2()
, it also has its own reader, processor, and writer. And this reader is read from table A, and by logic, it need to depends on the data update in table A.
However, when I run this batch job, I found that my step2()
reader is actually selecting same data as step1()
, anyway I can make the step1()
writer to commit first, then my step2()
reader read the updated data?