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

Reduce the amount of reflection registration in native image for Hibernate ORM value generators #32609

Open
yrodiere opened this issue Apr 13, 2023 · 1 comment
Labels

Comments

@yrodiere
Copy link
Member

Description

Follow-up on #32433

Ideally we should not need reflection on all generator classes, but only those that are actually used in the application.

Implementation ideas

We could try to detect at build time the value generators that will be used, but that might be fragile (especially since generator configuration in XML mapping is different, I believe).

We could try collecting the generator classes from the metadata during static init, and somehow pass those classes to a GraalVM "Feature", but I'm not sure that's even possible; so far I've only seen "build-time" reflection registration, even though the actual GraalVM calls happen in-JVM during static init.

But ideally, we would improve Hibernate ORM so that it resolves constructors during static init, which might completely remove the need to enable reflection on generator classes. I've done something like that before, for JPA event listeners: https://github.com/hibernate/hibernate-orm/pull/4296/files#diff-c24aac287c39a1f113fe6f2b8f7f1e419673977a65c5a31eb02a5a371fa83844R25-R39

@yrodiere yrodiere added kind/enhancement New feature or request area/hibernate-orm Hibernate ORM labels Apr 13, 2023
@quarkus-bot
Copy link

quarkus-bot bot commented Apr 13, 2023

/cc @Sanne (hibernate-orm), @gsmet (hibernate-orm)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant