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

[WIP] Upgrade to Hibernate ORM 7 #41310

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

[WIP] Upgrade to Hibernate ORM 7 #41310

wants to merge 10 commits into from

Conversation

yrodiere
Copy link
Member

@yrodiere yrodiere commented Jun 19, 2024

This is WIP to upgrade Quarkus to Hibernate ORM 7 -- which isn't stable yet.

Based on #41359, which must be merged first. => Done

Opening the PR as draft for anyone needing to build something on top of it.

Fixes #45164
Fixes #43368

Status / next steps:

@quarkus-bot quarkus-bot bot added area/dependencies Pull requests that update a dependency file area/hibernate-orm Hibernate ORM area/hibernate-reactive Hibernate Reactive area/persistence OBSOLETE, DO NOT USE labels Jun 21, 2024
@yrodiere yrodiere changed the title Upgrade to Hibernate ORM 7 [WIP] Upgrade to Hibernate ORM 7 Jun 25, 2024
@yrodiere yrodiere force-pushed the orm7 branch 2 times, most recently from 85327ca to 8d25fb0 Compare June 28, 2024 14:28
@quarkus-bot quarkus-bot bot added area/documentation area/panache area/spring Issues relating to the Spring integration labels Jun 28, 2024
@gsmet
Copy link
Member

gsmet commented Sep 4, 2024

Should we try to coordinate the Jakarta EE 11 updates?

@yrodiere
Copy link
Member Author

yrodiere commented Sep 5, 2024

Should we try to coordinate the Jakarta EE 11 updates?

Quarkus definitely should plan for that, yes. I don't know the full implications for Quarkus, but I think at least CDI, Narayana and Validator (so probably EL too?) will need to be upgraded before or at the same time as we upgrade to Hibernate ORM 7.0. As well as Search and Reactive, of course.
Upgrading every Jakarta component to Jakarta 11 would probably be simpler than trying to mix Jakarta 10 and 11, but that's up to you.

Fair warning though:

  1. ORM 7.0 is not ready yet -- there's no clear date set for the release at the moment.
  2. I'm only just getting back to this, trying to get things to compile ( ✔️ ) and basic tests to pass ( ❌ ), so that I can report any bugs upstream.

I'll set a reminder to ping you when I have a clearer view of what works and what doesn't in Quarkus itself.

@yrodiere yrodiere force-pushed the orm7 branch 2 times, most recently from 464af78 to 5f014d5 Compare September 16, 2024 12:18
@quarkus-bot quarkus-bot bot added area/devtools Issues/PR related to maven, gradle, platform and cli tooling/plugins area/jdbc Issues related to the JDBC extensions labels Sep 16, 2024
Copy link

github-actions bot commented Sep 16, 2024

🎊 PR Preview f040b40 has been successfully built and deployed to https://quarkus-pr-main-41310-preview.surge.sh/version/main/guides/

  • Images of blog posts older than 3 months are not available.
  • Newsletters older than 3 months are not available.

@yrodiere
Copy link
Member Author

I identified the Kotlin failures as a bug in hibernate-models: hibernate/hibernate-models#99
Looking into the other failures...

@yrodiere
Copy link
Member Author

The XML mapping issue seems caused by https://hibernate.atlassian.net/browse/HHH-18662.

@yrodiere
Copy link
Member Author

Alright, I think I did all I could at this point. I will need new Beta releases of Hibernate ORM / Search / Reactive to go further.

@yrodiere
Copy link
Member Author

I pushed an upgrade to ORM 7.0.0.Beta2, but now the build is failing even earlier.

Status:

  1. ORM needs a Beta3, because Beta2 has incorrect dependencies or a missing artifact:
    [ERROR] Failed to execute goal on project quarkus-hibernate-orm-derby: Could not resolve dependencies for project io.quarkus:quarkus-hibernate-orm-derby:jar:999-SNAPSHOT
    [ERROR] dependency: org.hibernate.orm:hibernate-scan-jandex:jar:7.0.0.Beta2 (runtime)
    [ERROR]         Could not find artifact org.hibernate.orm:hibernate-scan-jandex:jar:7.0.0.Beta2 in central (https://repo.maven.apache.org/maven2)
    
  2. Search needs an 8.0.0.Alpha1
  3. Reactive needs an Alpha/Beta as well... which may require further changes to ORM.

@yrodiere yrodiere force-pushed the orm7 branch 3 times, most recently from 3e07188 to 45179d2 Compare December 19, 2024 15:52
@yrodiere
Copy link
Member Author

I upgraded my branch to Hibernate ORM 7.0.0.Beta3 / Hibernate Reactive 3.0.0.Beta1, let's see what CI thinks... 🤞

@FroMage FYI ^

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.
Otherwise some direct uses of BeanContainer in ORM will just fail,
due to Arc not implementing all features.

Technically I think it doesn't change much right now, but will have an
impact if we enable more "CDI extensions" (see last commit).
…equired dependencies

With Derby moving to hibernate-community-dialects, Quarkus will need to
add this dependency automatically.
…ilder

Some of these changes probably pre-date Hibernate ORM 7.0,
we just forgot to implement them.
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 Hibernate Reactive area/jdbc Issues related to the JDBC extensions area/panache area/persistence OBSOLETE, DO NOT USE area/spring Issues relating to the Spring integration
Projects
Development

Successfully merging this pull request may close these issues.

Upgrade to Hibernate ORM 7 Panache projection handles primitive type incorrectly
2 participants