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

Delegate detection of the database version to the Hibernate ORM dialect #43764

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

yrodiere
Copy link
Member

@yrodiere yrodiere commented Oct 8, 2024

Fixes #43703
Fixes #42255

Based on #41310 and #43762, which must be merged first. Critically, #41310 requires Hibernate ORM 7.0.0.Final to be released, so we won't be able to merge this PR for a while. I'm submitting it anyway as a draft, so that we remember it's that easy: only the last two commits will be needed after we rebase.

@quarkus-bot quarkus-bot bot added area/dependencies Pull requests that update a dependency file area/devtools Issues/PR related to maven, gradle, platform and cli tooling/plugins area/documentation area/hibernate-orm Hibernate ORM area/hibernate-reactive area/jdbc Issues related to the JDBC extensions labels Oct 8, 2024
@quarkus-bot
Copy link

quarkus-bot bot commented Oct 8, 2024

/cc @gsmet (hibernate-orm)

@yrodiere yrodiere removed area/dependencies Pull requests that update a dependency file area/devtools Issues/PR related to maven, gradle, platform and cli tooling/plugins area/jdbc Issues related to the JDBC extensions labels Oct 8, 2024
@quarkus-bot quarkus-bot bot added area/dependencies Pull requests that update a dependency file area/devtools Issues/PR related to maven, gradle, platform and cli tooling/plugins area/jdbc Issues related to the JDBC extensions labels Oct 8, 2024
This allows disabling the check on startup if one knows the database
won't be reachable.

It also currently defaults to being disabled when a dialect is set
explicitly (`quarkus.hibernate-orm.dialect=something`),
in order to work around problems we have with correctly
detecting the version on some databases that we don't have tests for
(unsupported ones).
First because there's no reason not to (we're not testing the behavior
for unmapped attributes), and second to work around a bug in Hibernate
ORM 7.0 alphas/betas: https://hibernate.atlassian.net/browse/HHH-18662
…ersistenceProvider

Not strictly necessary, but doesn't hurt and might allow more changes in
the next commits.
Because:

1. We currently disallow this for identifier generators only
   through a custom initializer for the identifier generator
   factory service, but that service is disappearing in Hibernate
   ORM 7.0.0.Beta1, leaving us only the setting `hibernate.cdi.extensions`.
   to disallow CDI for identifier generators -- and anything else
   that impacts metadata creation.
2. This is needed for quarkusio#40897,
   which will move more of metadata creation to build time -- where CDI
   is just not available.
3. Implementations of affected components needing access to CDI at
   runtime (so not during metadata creation) can still do so by
   calling `Arc.container()` to retrieve the relevant beans.
…equired dependencies

With Derby moving to hibernate-community-dialects, Quarkus will need to
add this dependency automatically.
Because some dialects have very specific ways of detecting the version,
such as running some SQL, that work better than asking the JDBC driver.
…licit Hibernate ORM dialects

Because that detection is now done by the Hibernate ORM dialect itself,
and should work properly for all dialects.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/dependencies Pull requests that update a dependency file area/devtools Issues/PR related to maven, gradle, platform and cli tooling/plugins area/documentation area/hibernate-orm Hibernate ORM area/hibernate-reactive area/jdbc Issues related to the JDBC extensions
Projects
None yet
1 participant