I have jobs in Spring Batch that are launched without parameters. This jobs are not restartable, so we use the -next argument and a JobParametersIncrementer to allow the execution of these jobs as a new execution each time. The -next argument needs to load all executionContexts to get the new unique JobParameters with the incrementer (CommandLineJobRunner line 492). The problem is that sometimes, a new release can change an object stored in the execution context, and the last execution context can become unserializable with the new release.
Is there a good way or a better practice to launch a job without parameters and allow changes in objects stored in the execution context ? Do we have to clear the repository history at every releases to avoid any failure, or is there a better solution ?