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

Upgrade to Hibernate ORM 6.5 / Hibernate Reactive 2.3 #40102

Merged
merged 3 commits into from
Apr 26, 2024

Conversation

yrodiere
Copy link
Member

@yrodiere yrodiere commented Apr 16, 2024

Draft because we only have CRs of these libraries for now, no Final version.

This should fix the following upstream issues:

Fixes #38722
Fixes #37735
Fixes #2815

We'll need to have a look at #37575 once we have some time; it's possible the new, official property for disabling JDBC metadata retrieval works a bit better (but I'm not sure). Related: #30002 , #13522.

Copy link

quarkus-bot bot commented Apr 16, 2024

Thanks for your pull request!

The title of your pull request does not follow our editorial rules. Could you have a look?

  • title should preferably start with an uppercase character (if it makes sense!)

This message is automatically generated by a bot.

@quarkus-bot quarkus-bot bot added area/dependencies Pull requests that update a dependency file area/hibernate-orm Hibernate ORM area/persistence OBSOLETE, DO NOT USE labels Apr 16, 2024
Copy link

quarkus-bot bot commented Apr 16, 2024

/cc @gsmet (hibernate-orm)

@yrodiere yrodiere marked this pull request as ready for review April 16, 2024 13:57
@yrodiere
Copy link
Member Author

Marking as ready for review to get a full CI run. Please don't merge just yet.

@yrodiere yrodiere added the triage/on-ice Frozen until external concerns are resolved label Apr 16, 2024

This comment has been minimized.

@@ -394,6 +396,30 @@ public Object get(String entityName, Object id, LockMode lockMode) {
}
}

@Override
public Filter enableFilter(String filterName) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No rush, but it might be worth adding a base class in ORM for these use cases.

I always considered the "Session API" would be rock stable and not worth the hassle, but in practice it seems there's some adjustment needed quite often..

Copy link
Member Author

@yrodiere yrodiere Apr 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See https://hibernate.atlassian.net/browse/HHH-17990. Please have a look at the comments too, as it's not as straightforward as one might think, given what Quarkus does in such "proxy" classes.

BTW if only we had support for generating proxies at extension build time, we could solve this much more easily on the Quarkus side... Provided we have some metadata regarding which method implies data mutation or DB access.

This comment has been minimized.

@yrodiere yrodiere changed the title [WIP] Upgrade to Hibernate ORM 6.5 / Hibernate Reactive 2.3 Upgrade to Hibernate ORM 6.5 / Hibernate Reactive 2.3 Apr 22, 2024
@yrodiere yrodiere removed the triage/on-ice Frozen until external concerns are resolved label Apr 22, 2024
@yrodiere
Copy link
Member Author

yrodiere commented Apr 22, 2024

CI doesn't get executed and I don't understand why. I've removed [WIP] from the title and the on-ice label, let's see how it goes now...

EDIT: Please don't merge yet though!

This comment has been minimized.

@yrodiere
Copy link
Member Author

FYI I'm currently investing the failures.

The JVM failures are about a bug in ORM where H2 native enum order is handled incorrectly (@beikov is on it) and a bug in Reactive's implementation of getRefrence (@DavideD is on it).

Now I'll look at the native failures...

@yrodiere
Copy link
Member Author

yrodiere commented Apr 23, 2024

Related upstream fixes so far:

hibernate/hibernate-orm@1166e64
hibernate/hibernate-reactive#1892
hibernate/hibernate-orm#8226 (needs backport)

@yrodiere yrodiere force-pushed the orm6.5 branch 2 times, most recently from 5173173 to 3c33195 Compare April 23, 2024 14:21

This comment has been minimized.

@quarkus-bot quarkus-bot bot added the area/infra-automation anything related to CI, bots, etc. that are used to automated our infrastructure label Apr 23, 2024

This comment has been minimized.

@yrodiere
Copy link
Member Author

Another image metrics change:

2024-04-24T10:08:57.6758269Z [ERROR] Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 10.31 s <<< FAILURE! -- in io.quarkus.it.jpa.postgresql.ImageMetricsITCase
2024-04-24T10:08:57.6779385Z [ERROR] io.quarkus.it.jpa.postgresql.ImageMetricsITCase.verifyImageMetrics -- Time elapsed: 0.330 s <<< FAILURE!
2024-04-24T10:08:57.6782495Z org.opentest4j.AssertionFailedError: Expected analysis_results.types.reflection to be within range [6522 +- 3%] but was 6732 ==> expected: <true> but was: <false>

I just checked on main: the number before even upgrading to Hibernate ORM 6.5 is 6704 with Mandrel 23.1.2.0 and 6705 with Mandrel 23.1.1.0.

So Hibernate ORM 6.5 only accounts for 28 new types registered for reflection. Not great, but certainly not a reason to fail the build.

For now I'll just bump the numbers to whatever native image generation reports before the upgrade.

@yrodiere yrodiere changed the title Upgrade to Hibernate ORM 6.5 / Hibernate Reactive 2.3 [WIP] Upgrade to Hibernate ORM 6.5 / Hibernate Reactive 2.3 Apr 24, 2024

This comment has been minimized.

@zakkak
Copy link
Contributor

zakkak commented Apr 25, 2024

@yrodiere please note that previous Hibernate ORM updates have also increased the elements registered for reflection (and this the binary size), see:

  1. jpa-postgresql native image size increase (on Mandrel-23.1.2.0-Final) #39674 (comment)
  2. jpa-postgresql native image size increase (on Mandrel-23.1.2.0-Final) #39674 (comment)

It looks like there is a trend with newer versions bringing in more and more things.

@yrodiere
Copy link
Member Author

It looks like there is a trend with newer versions bringing in more and more things.

Yes, new versions come with new features.

@zakkak
Copy link
Contributor

zakkak commented Apr 25, 2024

Yes, new versions come with new features.

Sure, but in theory we don't use all these new features (e.g. the integration tests didn't change) so ideally Quarkus should be able to contain their impact on the resulting native executables.

@yrodiere
Copy link
Member Author

Yes, ideally. I'll add this to the stack of items to work on... no promises :/

This comment has been minimized.

@yrodiere yrodiere force-pushed the orm6.5 branch 2 times, most recently from 9e1d53b to c44e9e1 Compare April 26, 2024 08:02
@yrodiere yrodiere changed the title [WIP] Upgrade to Hibernate ORM 6.5 / Hibernate Reactive 2.3 Upgrade to Hibernate ORM 6.5 / Hibernate Reactive 2.3 Apr 26, 2024
@yrodiere yrodiere removed the triage/on-ice Frozen until external concerns are resolved label Apr 26, 2024
@yrodiere
Copy link
Member Author

.Final releases are out, and the PR is now using them.

Let's see whether CI is happy...

@yrodiere yrodiere added the triage/waiting-for-ci Ready to merge when CI successfully finishes label Apr 26, 2024
@yrodiere yrodiere merged commit bbe9cbc into quarkusio:main Apr 26, 2024
50 checks passed
@quarkus-bot quarkus-bot bot removed the triage/waiting-for-ci Ready to merge when CI successfully finishes label Apr 26, 2024
@quarkus-bot quarkus-bot bot added this to the 3.11 - main milestone Apr 26, 2024
Copy link

quarkus-bot bot commented Apr 26, 2024

Status for workflow Quarkus CI

This is the status report for running Quarkus CI on commit c44e9e1.

✅ The latest workflow run for the pull request has completed successfully.

It should be safe to merge provided you have a look at the other checks in the summary.

You can consult the Develocity build scans.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/arc Issue related to ARC (dependency injection) area/core area/dependencies Pull requests that update a dependency file area/hibernate-orm Hibernate ORM area/infra-automation anything related to CI, bots, etc. that are used to automated our infrastructure area/panache area/persistence OBSOLETE, DO NOT USE area/resteasy-classic kind/bugfix triage/flaky-test
Projects
None yet
4 participants