Skip to content

Add support to configure job instance incrementer name through environment variable / system property#5332

Closed
trisberg wants to merge 3 commits intospring-projects:mainfrom
trisberg:topic/trisberg/issue-5245
Closed

Add support to configure job instance incrementer name through environment variable / system property#5332
trisberg wants to merge 3 commits intospring-projects:mainfrom
trisberg:topic/trisberg/issue-5245

Conversation

@trisberg
Copy link
Member

In order to be able to run both Batch 5 and 6 jobs we need a way to use the same database schema.

This PR introduces an environment variable SPRING_BATCH_JDBC_SCHEMA_CLASSIC in order to override the name for the job instance incrementer used. The classic Batch 5 schema used JOB_SEQ while the Batch 6 schema uses JOB_INSTANCE_SEQ.

See issue: #5245

@trisberg trisberg force-pushed the topic/trisberg/issue-5245 branch from 16ddaae to 146857d Compare March 11, 2026 15:44
Signed-off-by: trisberg <thomas.risberg@broadcom.com>
@trisberg trisberg force-pushed the topic/trisberg/issue-5245 branch from 146857d to 86eb8c1 Compare March 11, 2026 15:48
@trisberg trisberg marked this pull request as draft March 11, 2026 17:11
Signed-off-by: trisberg <thomas.risberg@broadcom.com>
Signed-off-by: trisberg <thomas.risberg@broadcom.com>
@trisberg trisberg marked this pull request as ready for review March 12, 2026 13:08
fmbenhassine added a commit that referenced this pull request Mar 18, 2026
- Use inner class for test configuration
- Rename env variable and property
- Refactor tests
@fmbenhassine
Copy link
Contributor

LGTM. Rebased, squashed and merged as 4580c59. Refined in 80e4349 (some minor changes).

I made the exception to introduce this in a patch release. But I will plan a more comprehensive feature to configure Spring Batch through the environment for non Boot users (similar to other projects in the portfolio, for example like Spring Integration, which has this capability).

Thank you for your contribution, @trisberg !

@fmbenhassine fmbenhassine added this to the 6.0.3 milestone Mar 18, 2026
@fmbenhassine fmbenhassine changed the title Add check for env var overriding classic job instance incrementer name Add support to configure job instance incrementer name through environment variable / system property Mar 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants