Joris Kuipers (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
) *created* an issue
Hibernate ORM (
https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiM2FjZjM2N2Vh...
) / Bug (
https://hibernate.atlassian.net/browse/HHH-16968?atlOrigin=eyJpIjoiM2FjZj...
) HHH-16968 (
https://hibernate.atlassian.net/browse/HHH-16968?atlOrigin=eyJpIjoiM2FjZj...
) StackOverflowError when using NaturalIdLoadAccess and bi-directional association (
https://hibernate.atlassian.net/browse/HHH-16968?atlOrigin=eyJpIjoiM2FjZj...
)
Issue Type: Bug Affects Versions: 6.2.6 Assignee: Unassigned Attachments:
hibernate-stackoverflowerror.zip, image-20230721-135438.png Components:
hibernate-orm-modules Created: 21/Jul/2023 06:54 AM Priority: Major Reporter: Joris
Kuipers (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
)
While migrating an existing application to Hibernate 6.x, I noticed that some code was
starting to fail with a StackOverflowError. It seems like this is related to the fact that
our code uses Hibernate’s natural key loading support in these cases.
I’ve created a quite trivial example to reproduce the issue; it uses Spring to bootstrap
Hibernate as a JPA provider, but I’m not relying on something like Spring Data JPA in any
way. This is all “pure” Hibernate, AFAICT.
You can simply run the Spring Boot application to see the problem in action. Here’s a
screenshot of the debugger showing the issue: the navigablePath keeps on growing as the
bi-directional association is being navigated.
(
https://hibernate.atlassian.net/rest/api/3/attachment/content/50516 )
(
https://hibernate.atlassian.net/browse/HHH-16968#add-comment?atlOrigin=ey...
) Add Comment (
https://hibernate.atlassian.net/browse/HHH-16968#add-comment?atlOrigin=ey...
)
Get Jira notifications on your phone! Download the Jira Cloud app for Android (
https://play.google.com/store/apps/details?id=com.atlassian.android.jira....
) or iOS (
https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=Em...
) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100232- sha1:4329f54 )