From 8745470bf01061313532d4b416d38283c9a72a60 Mon Sep 17 00:00:00 2001 From: Mahmoud Ben Hassine Date: Tue, 16 May 2023 08:38:17 +0200 Subject: [PATCH] Updated Spring Batch 5.0 Migration Guide (markdown) --- Spring-Batch-5.0-Migration-Guide.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Spring-Batch-5.0-Migration-Guide.md b/Spring-Batch-5.0-Migration-Guide.md index 3d6c253..d695d23 100644 --- a/Spring-Batch-5.0-Migration-Guide.md +++ b/Spring-Batch-5.0-Migration-Guide.md @@ -287,6 +287,17 @@ parameterName='{"value": "parameterValue", "type":"parameterType", "identifying" where `parameterType` is the fully qualified name of the type of the parameter. Spring Batch provides the `JsonJobParametersConverter` to support this notation. +### Historical data access implications + +Due to this breaking change about handling job parameters, some APIs that are designed to explore batch meta-data should **not** be used +for job instances that were launched with v4. For example: + +* `JobExplorer#getJobInstances` could retrieve a mix of historical data between v4 and v5 and might fails at loading job parameters of v4 ([#4352](https://github.com/spring-projects/spring-batch/issues/4352)). In this particular case, make sure to start at the index of the first instance executed with v5. +* `JobExplorer#getJobExecution` could fail at retrieving job parameters if the passed job execution ID is one of an execution that was run with v4. + +Another case where this change has implications on loading job parameters is when restarting failed job instances. It is expected that +all failed v4 job instances are either restarted to success or abandoned _before_ the migration to v5 is done. + # Deprecated APIs The following APIs have been deprecated in version 5.0: