Skip to content

Conversation

@hpoettker
Copy link
Contributor

This is a follow-up on #784, which fixed the failing start-up of SCT applications with lazy initialization. When I submitted an analogous PR to Spring Boot for the Spring Batch auto-configuration (spring-projects/spring-boot#27144), @wilkinsona let me know that there is a much more bootiful way to go about it. 😄

The PR is based on #788 as it leverages the DatabaseInitializationDependencyConfigurer and its detectors, which were introduced with Spring Boot 2.5. When #788 is merged, I'll rebase the branch for this PR on main.

@hpoettker
Copy link
Contributor Author

I've rebased the branch on main.

@hpoettker
Copy link
Contributor Author

It's been a while. 😄

I've updated the PR by fixing merge conflicts, applying spring-javaformat, and using Set::of. More interestingly, I've given TaskRepositoryDatabaseInitializerDetector the same precedence as Spring Boot's DataSourceScriptDatabaseInitializerDetector which detects (among others) BatchDataSourceScriptDatabaseInitializer.

Unless it's planned to let TaskRepositoryInitializer implement DataSourceScriptDatabaseInitializer, the PR still seems fine to me.

@cppwfs
Copy link
Collaborator

cppwfs commented Oct 31, 2022

LGTM

@cppwfs
Copy link
Collaborator

cppwfs commented Oct 31, 2022

Thank you for this contribution! and the sample that displayed the issue.
Rebased Merged

@cppwfs cppwfs closed this Oct 31, 2022
@hpoettker hpoettker deleted the db-init-revisited branch October 31, 2022 14:27
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

Successfully merging this pull request may close these issues.

2 participants