-
Notifications
You must be signed in to change notification settings - Fork 2.4k
-
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?
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 1 comment 2 replies
-
Have you annotated the datasource to use for Spring Batch with @BatchDataSource
? This annotation is deigned for this use case.
Beta Was this translation helpful? Give feedback.
All reactions
-
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?
Beta Was this translation helpful? Give feedback.
All reactions
-
From the Javadocs, I understand that this annotation should be used if there is another datasource marked as primary, which is your case IIUC.
Beta Was this translation helpful? Give feedback.