I have a Spring batch step reader where the query is complex and contains join of several tables. Job will be run everyday looking for records that were added to table A, based on the last updated date. In the scenario where no records were added, the query still takes a long time to return results. I would like to check if there were any records that were added to table A, and only then run the full query. Example : select count(recordID) from table A where last_update_date > If count > 0, then proceed with the step (reader, writer etc) joining the other tables. If count = 0, then skip the reader, writer and set step status as COMPLETED and proceed with the next step of the job. Is this possible in Spring batch ? If yes, how can this be done?
0
votes
1 Answers
0
votes
Use a StoredProcedureItemReader.
Or a JobExecutionDecider where perform fast query and move to processing step or to job termination.