Skip to content

Remove datasource autowiring in AbstractBatchConfiguration #4103

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

Closed
wants to merge 3 commits into from

Conversation

fmbenhassine
Copy link
Contributor

Before this commit, the datasource was autowired in
AbstractBatchConfiguration. This was causing context
startup failures when no datasource or more than one
datasource is present in the context.

This commit fixes these failures by looking for the
datasource in the application context. This also
prevents cyclic configuration dependencies when
the datasource bean is defined in the same class where
other batch artifacts are autowired.

Issue #3991

@fmbenhassine fmbenhassine added this to the 5.0.0 milestone Apr 25, 2022
@fmbenhassine fmbenhassine requested a review from cppwfs April 25, 2022 12:32
@fmbenhassine fmbenhassine self-assigned this Apr 25, 2022
@fmbenhassine fmbenhassine removed this from the 5.0.0 milestone May 4, 2022
Before this commit, the datasource was autowired in
AbstractBatchConfiguration. This was causing context
startup failures when no datasource or more than one
datasource is present in the context.

This commit fixes these failures by looking for the
datasource in the application context. This also
prevents cyclic configuration dependencies when
the datasource bean is defined in the same class where
other batch artifacts are autowired.

Issue spring-projects#3991
- Restore tests with no datasource
- Fix error message
@fmbenhassine fmbenhassine marked this pull request as ready for review May 13, 2022 12:34
@fmbenhassine
Copy link
Contributor Author

Rebased and merged as 33338a4. Thank you for the review @cppwfs !

@fmbenhassine fmbenhassine deleted the GH-3991 branch May 13, 2022 18:04
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