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

Setup DataSource early to take advantage of AutoConfiguration #625

Open
basejump opened this issue Sep 26, 2022 · 0 comments
Open

Setup DataSource early to take advantage of AutoConfiguration #625

basejump opened this issue Sep 26, 2022 · 0 comments

Comments

@basejump
Copy link
Contributor

Its looks to me like we can have an AutoConfiguration that will work with both Grails or Spring Boot/Micronaut.

  • If we use AutoConfiguration to setup the DataSource early using the then all the other AutoConfiguration that depend on datasource can be taken advantage of.
  • as it stands no in grails-plugin, its setup to late in the process for the other Autoconfigurations to get picked up
  • grails HibernateDatastoreConnectionSourcesRegistrar.postProcessBeanDefinitionRegistry sets up the dataSource but checks for existing first.
  • in order for other spring boot Autoconfigure (such as actuator metrics) to get picked up then datasource needs to be setup early.

so instead of using HibernateDatastoreSpringInitializer it can autoconfigure the dataSourceConnectionSourceFactory(CachedDataSourceConnectionSourceFactory)
and the Datasource early (which looks like it should be a factory based on dataSourceConnectionSourceFactory)

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

No branches or pull requests

1 participant