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
Migrations performed by Flyway or Liquibase may not have completed before the database is accessed via jOOQ #25055
Comments
Interesting, could this be a more general problem? Would a migration-aware |
It is a general problem and we have a (fairly) general solution for it. There's a bug here as we've neglected to use that solution for jOOQ's
Other than one scenario involved deferred bootstrapping of JPA, everything is single threaded. We need to ensure that things happen in the right order rather than preventing them from happening in parallel. |
I see, thanks for the explanation! |
In order to make sure that `Jooq` is used when `flyway` and `liquibase` beans are created and migrations are done, `DslContextDependsOnPostProcessor` was added. See spring-projectsgh-25055
Closing in favour of #25279. |
@wilkinsona I've found this issue while using Spring Boot 2.7.3 probably suffering exactly from the problem that Flyway might not have run during application startup but already using jOOQ's I've seen this fix here has been forward-ported to 2.4.x, but I can't tell how it's now solved from 2.5.x onwards. Searching |
|
@wilkinsona Thanks a lot for this immediate answer. I'll see if I can reproduce it now that I believe jOOQ is indeed later available than Flyway 👍 |
If jOOQ is used to interact with a database during application context refresh, migrations performed by Flyway or Liquibase may not have completed. This can happen because there's no guarantee that the Flyway or Liquibase beans will have been created and initialised before any jOOQ beans are created and used. I think we need some
AbstractDependsOnBeanFactoryPostProcessor
beans so that any jOOQDSLContext
beans depend on the Flyway and Liquibase beans.The text was updated successfully, but these errors were encountered: