Skip to content

Conversation

gsmet
Copy link
Member

@gsmet gsmet commented Aug 16, 2025

Better reviewed commit per commit.

@quarkus-bot quarkus-bot bot added the area/hibernate-orm Hibernate ORM label Aug 16, 2025
@gsmet gsmet requested review from Sanne and yrodiere August 16, 2025 18:09

This comment has been minimized.

generatedProxyQueue.add(buildExecutor.submit(() -> {
DynamicType.Unloaded<?> unloaded = proxyHelper.buildUnloadedProxy(managedClassOrPackageName,
proxyInterfaceNames);
return new CachedProxy(managedClassOrPackageName, unloaded, proxyInterfaceNames);
Copy link
Member

Choose a reason for hiding this comment

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

Very nice.

I noticed something odd though - the parameter proxyInterfaceNames passed to buildUnloadedProxy is a Set whose content is always the same? IFF that's the case then the buildUnloadedProxy could resolve the types in advance and also reuse as a constant.
But it looks like suspicious, like if we lost something during previous changes.

Copy link
Member Author

Choose a reason for hiding this comment

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

Maybe. I don't want to open a can of worms here.

I tried to "optimize" things a bit here but it makes the code less readable. Given the description of the type will be in the TypePool cache after the first call, I think we are good.

Copy link
Member

Choose a reason for hiding this comment

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

The quirkiness is a result of my (botched?) upgrade to Hibernate ORM 7: 6f4cfac#diff-583c184a7bb985fc15d72cd11861e77f12dbd3332307065f3122b8d6390c1602L1371-R1367

In short, previously you could add custom interface names with @Proxy, but that's gone in ORM 7+.

I'll send a PR to do what Sanne suggested.

Copy link
Member

Choose a reason for hiding this comment

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

nice, thanks 👍

@gsmet gsmet force-pushed the hibernate-proxy-improvements branch from ea7eac5 to 531bc1b Compare August 18, 2025 07:41
Copy link
Member

@yrodiere yrodiere left a comment

Choose a reason for hiding this comment

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

Most changes look fine, but unless I'm missing something (and I very well might be), it seems the proxy cache is no longer populated?

This raises the question: was this done to fix a particular problem, and is there a benchmark we could use to check how effective it is? It's fine if there isn't, but if there is that would give a lot more confidence there isn't some hard-to-catch issue like this.

@gsmet gsmet force-pushed the hibernate-proxy-improvements branch from 531bc1b to 93e17ca Compare August 18, 2025 08:52
@gsmet gsmet force-pushed the hibernate-proxy-improvements branch from 93e17ca to 1a6978a Compare August 18, 2025 09:15
@gsmet gsmet force-pushed the hibernate-proxy-improvements branch from 1a6978a to 8bd0f55 Compare August 18, 2025 09:23
Copy link

quarkus-bot bot commented Aug 18, 2025

Status for workflow Quarkus CI

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

✅ 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.

@yrodiere yrodiere merged commit e8073d1 into quarkusio:main Aug 18, 2025
47 checks passed
@quarkus-bot quarkus-bot bot added this to the 3.28 - main milestone Aug 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/hibernate-orm Hibernate ORM
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants