Skip to content

Add transaction manager and timestamp migration recipes for Spring Batch#923

Merged
timtebeek merged 3 commits intomainfrom
spring-batch-5-transaction-manager-timestamps
Jan 29, 2026
Merged

Add transaction manager and timestamp migration recipes for Spring Batch#923
timtebeek merged 3 commits intomainfrom
spring-batch-5-transaction-manager-timestamps

Conversation

@timtebeek
Copy link
Member

@timtebeek timtebeek commented Jan 29, 2026

…tch 5.0

Add two new recipes to the Spring Batch 4→5 migration:

  • AddTransactionManagerToTaskletAndChunk: Spring Batch 5.0 requires a PlatformTransactionManager as the second argument to tasklet() and chunk() calls on StepBuilder. This recipe adds the transactionManager parameter to the enclosing method and passes it to these calls.

  • MigrateStepExecutionTimestampTypes: StepExecution and JobExecution timestamp methods (getStartTime, getEndTime, getCreateTime, getLastUpdated) now return LocalDateTime instead of Date. This recipe updates variable declarations accordingly.

Also adds ChangeType for JobRegistryBeanPostProcessor → JobRegistrySmartInitializingSingleton to the composite recipe.

  • Fixes moderneinc/customer-requests#507

What's changed?

What's your motivation?

Anything in particular you'd like reviewers to focus on?

Anyone you would like to review specifically?

Have you considered any alternatives or workarounds?

Any additional context

Checklist

  • I've added unit tests to cover both positive and negative cases
  • I've read and applied the recipe conventions and best practices
  • I've used the IntelliJ IDEA auto-formatter on affected files

…tch 5.0

Add two new recipes to the Spring Batch 4→5 migration:

- AddTransactionManagerToTaskletAndChunk: Spring Batch 5.0 requires a
  PlatformTransactionManager as the second argument to tasklet() and chunk()
  calls on StepBuilder. This recipe adds the transactionManager parameter to
  the enclosing method and passes it to these calls.

- MigrateStepExecutionTimestampTypes: StepExecution and JobExecution timestamp
  methods (getStartTime, getEndTime, getCreateTime, getLastUpdated) now return
  LocalDateTime instead of Date. This recipe updates variable declarations
  accordingly.

Also adds ChangeType for JobRegistryBeanPostProcessor →
JobRegistrySmartInitializingSingleton to the composite recipe.

Fixes moderneinc/customer-requests#507
@timtebeek timtebeek self-assigned this Jan 29, 2026
@github-project-automation github-project-automation bot moved this to In Progress in OpenRewrite Jan 29, 2026
@github-project-automation github-project-automation bot moved this from In Progress to Ready to Review in OpenRewrite Jan 29, 2026
@timtebeek timtebeek merged commit 42e72a4 into main Jan 29, 2026
2 checks passed
@timtebeek timtebeek deleted the spring-batch-5-transaction-manager-timestamps branch January 29, 2026 13:44
@github-project-automation github-project-automation bot moved this from Ready to Review to Done in OpenRewrite Jan 29, 2026
@timtebeek
Copy link
Member Author

@ielatif Thought you might be interested in seeing these cases covered still. Was good to see you yesterday!

@ielatif
Copy link
Contributor

ielatif commented Jan 29, 2026

@timtebeek definitely! Thanks for sharing this.
I discovred also some uncovered cases while migrating my code to spring-batch 6, i'll submit PRs as soon as i can.
Yeah it was really good to see you yesterday and I hope to meet you in person in Paris :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants