Search code examples
springspring-batchspring-jdbc

JdbcPagingItemReader: questions about async/sync behaviour


i have a question about JdbcPagingItemReader: When we initialize the QueryProvider the method setSortKeys is is recommended to be used with an unique key constraint to guarantee that no data is lost between executions. Is it true for aync jobs? Because for async job we set saveState=false


Solution

  • Concurrency is not compatible with restartability. If you want to use the JdbcPagingItemReader in a concurrent step, then you can't restart the job (correctly) in case of failure.