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

Skip class transformer in PersistenceUnitInfoDescriptor for native images #30492

Closed
sdeleuze opened this issue May 15, 2023 · 8 comments
Closed
Assignees
Labels
in: data Issues in data modules (jdbc, orm, oxm, tx) theme: aot An issue related to Ahead-of-time processing type: enhancement A general enhancement
Milestone

Comments

@sdeleuze
Copy link
Contributor

Due to this change in Hibernate 6.2, Bytebuddy class enhancement is now invoked via SpringHibernateJpaPersistenceProvider -> PersistenceUnitInfoDescriptor - > EnhancingClassTransformerImpl -> BytecodeProviderInitiator.buildDefaultBytecodeProvider(), breaking Hibernate integration when compiling to native images.

This change updates the PersistenceUnitInfoDescriptor instance created by SpringHibernateJpaPersistenceProvider in order to skip the class transformer with native.

Footprint optimization will require completing #29549 is is outside of the scope of this change.

@sdeleuze sdeleuze added in: data Issues in data modules (jdbc, orm, oxm, tx) type: enhancement A general enhancement theme: aot An issue related to Ahead-of-time processing labels May 15, 2023
@sdeleuze sdeleuze added this to the 6.0.10 milestone May 15, 2023
@sdeleuze sdeleuze self-assigned this May 15, 2023
sdeleuze added a commit to sdeleuze/spring-framework that referenced this issue May 15, 2023
…ages

In order to restore native support with Hibernate 6.2, this
change updates the PersistenceUnitInfoDescriptor instance
created by SpringHibernateJpaPersistenceProvider in order to
skip the class transformer for native images.

Closes spring-projectsgh-30492
@edeandrea
Copy link
Contributor

Hi @sdeleuze if I use Spring Framework 6.0.10-SNAPSHOT should this issue be resolved? Or is there more to it?

@edeandrea
Copy link
Contributor

I opened oracle/graalvm-reachability-metadata#297 a little while ago, as this fix on its own doesn't seem to fix the issue.

@davidbilge
Copy link

@edeandrea using Spring Framework 6.0.10-SNAPSHOT should be enough, provided the maven-native-plugin uses the latest available reachability metadata version (0.3.1 at the time of writing).

See my comment spring-projects/spring-boot#35659 (comment) for more details.

@edeandrea
Copy link
Contributor

Thank you @davidbilge but that unfortunately didn't work.

@davidbilge
Copy link

Thank you @davidbilge but that unfortunately didn't work.

Did you try to use a specific version (0.3.1) of the reachability metadata in your pom.xml?

@edeandrea
Copy link
Contributor

Yes I did. I opened oracle/graalvm-reachability-metadata#297 for it.

@sdeleuze
Copy link
Contributor Author

We are going to release GraalVM metadata 0.3.2 and Native Build Tools 0.9.23 that contains all Hibernate 6.2 fixes.

mdeinum pushed a commit to mdeinum/spring-framework that referenced this issue Jun 29, 2023
…ages

In order to restore native support with Hibernate 6.2, this
change updates the PersistenceUnitInfoDescriptor instance
created by SpringHibernateJpaPersistenceProvider in order to
skip the class transformer for native images.

Closes spring-projectsgh-30492
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: data Issues in data modules (jdbc, orm, oxm, tx) theme: aot An issue related to Ahead-of-time processing type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

3 participants