首页 > 解决方案 > How can i make my Spring Batch job to restart from a specific value in the database column?

问题描述

I have a spring batch job that reads a database table and updates it with a chunk size of 5.

select * from table where col1 is null;

The batch job updates the column 'col1' sometimes and sometimes not based on business rules.

If the job fails, it is not restarting from where it left off. It skips some of the chunks as the query "select * from table where col1 is null;" will return a new result set as the previous run updated some of the col1 values.

Now instead of using the default execution context state for restart, can i use a specific value of Col1 say 50, and make the restart run all the records with col1 > 50 ?

标签: springspring-batch

解决方案


推荐阅读