Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regression in AbstractBatchConfiguration for dataSource Autowiring [BATCH-2819] #796

Open
spring-issuemaster opened this issue Apr 24, 2019 · 1 comment

Comments

@spring-issuemaster
Copy link
Collaborator

@spring-issuemaster spring-issuemaster commented Apr 24, 2019

Jean-Francois Larouche opened BATCH-2819 and commented

Hi,

This commit: 

7a9a2a9#diff-03a06349c3e7d9dcf99d6433a1d565db

When providing our own BatchConfigurer and wiring up the DastaSource correctly, this add a regression when none of the dataSource bean are @Primary. Because the SimpleBatchConfigurer is always created.

Would it not have been possible to iterate through the Collection inside getConfigurer(...) and just use the DataSource that have a @Primary in the list instead? This would have caused 0 regression.

Thanks.

New Error:

Field dataSource in org.springframework.batch.core.configuration.annotation.AbstractBatchConfiguration required a single bean, but 2 were found:Field dataSource in org.springframework.batch.core.configuration.annotation.AbstractBatchConfiguration required a single bean, but 2 were found: - batchDataSource: defined by method 'batchDataSource' in class path resource [com/sepaq/batch/config/DataSourceBatchConfig.class] - oracleDataSource: defined by method 'oracleDataSource' in class path resource [com/sepaq/batch/jpa/datasource/DataSourceOracleConfig.class]


Affects: 4.1.1, 4.1.2

@kimehdgns
Copy link

@kimehdgns kimehdgns commented Feb 3, 2020

I think that commit forces @primary annotation to be used or need bean with name "dataSource" in multiple datasource configurations. Even if I use in-memory job repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.