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

DataSource initialization does not see the result of wrapping or proxying a DataSource via a BeanPostProcessor #23736

Closed
wilkinsona opened this issue Oct 18, 2020 · 0 comments
Assignees
Labels
theme: datasource Issues relating to data sources type: bug A general bug
Milestone

Comments

@wilkinsona
Copy link
Member

wilkinsona commented Oct 18, 2020

@joshlong has been experimenting with using Spring Retry to make the auto-configured DataSource retry connection retrieval so that the DB does not have to be up when the app is starting. It doesn't work when also trying to initialise the data source with a schema.sql script.

The problem is that the retry proxy that is created in the BPP isn't seen by the data source initializer that's triggered by another BPP. The initializer retrieves the DataSource via an ObjectProvider which, because bean post-processing hasn't completed, cannot see the retry proxy created earlier in the post-processing.

https://github.com/bootiful-kubernetes/retryable-app-and-a-database/tree/b5dbcf9a3d32d0a8d40c0d54728ea97eb6ac9ddb reproduces the problem.

This is related to #9528, #13042 and the like. I doubt it'll be easy to fix. In the meantime using Flyway or Liquibase for initialization is recommended.

@wilkinsona wilkinsona added type: bug A general bug for: team-attention An issue we'd like other members of the team to review labels Oct 18, 2020
@wilkinsona wilkinsona added this to the 2.x milestone Oct 18, 2020
@philwebb philwebb removed the for: team-attention An issue we'd like other members of the team to review label Oct 26, 2020
@wilkinsona wilkinsona added the theme: datasource Issues relating to data sources label Feb 16, 2021
@wilkinsona wilkinsona modified the milestones: 2.x, 2.5.x Feb 17, 2021
@wilkinsona wilkinsona self-assigned this Feb 17, 2021
@wilkinsona wilkinsona modified the milestones: 2.5.x, 2.5.0-M2 Feb 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
theme: datasource Issues relating to data sources type: bug A general bug
Projects
None yet
Development

No branches or pull requests

2 participants