Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Spring Batch tables are not automatically created with multiple datasources using Spring Boot #4612

Unanswered
Sax388 asked this question in Q&A
Discussion options

I've read spring-projects/spring-boot#33526 and am using

spring:
 batch:
 job:
 # Don't run job on application startup
 enabled: false
 jdbc:
 initialize-schema: always

I've got multiple datasources and one is marked as @Primary.

There's no error message so I don't know to debug it. How can I find out, what I'm missing?

You must be logged in to vote

Replies: 1 comment 2 replies

Comment options

Have you annotated the datasource to use for Spring Batch with @BatchDataSource? This annotation is deigned for this use case.

You must be logged in to vote
2 replies
Comment options

I thought that @BatchDataSource was only needed if you wanted to use the secondary datasource for the Spring Batch tables. I thought the one marked as @Primary would be used by default. Is that a misconception?

Comment options

From the Javadocs, I understand that this annotation should be used if there is another datasource marked as primary, which is your case IIUC.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
status: waiting-for-reporter Issues for which we are waiting for feedback from the reporter

AltStyle によって変換されたページ (->オリジナル) /