Philip Lowney (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=5c18c2f...
) *created* an issue
Hibernate ORM (
https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiZjhkYTVhZTZm...
) / Bug (
https://hibernate.atlassian.net/browse/HHH-16871?atlOrigin=eyJpIjoiZjhkYT...
) HHH-16871 (
https://hibernate.atlassian.net/browse/HHH-16871?atlOrigin=eyJpIjoiZjhkYT...
) Queries returning null values for related entities depending on
'max_fetch_depth' (
https://hibernate.atlassian.net/browse/HHH-16871?atlOrigin=eyJpIjoiZjhkYT...
)
Issue Type: Bug Affects Versions: 6.2.5 Assignee: Unassigned Components: hibernate-core
Created: 29/Jun/2023 08:12 AM Priority: Major Reporter: Philip Lowney (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=5c18c2f...
)
We have recently upgraded to Hibernate 6.2.5.Final. After updating, we noted an issue
related to the max_fetch_depth parameter - depending on the value of max_fetch_depth ,
entity relationships defined on fetched entities as @ManyToOne and @OneToMany were being
set to *null* rather than initialised with a proxy. This appears to be a bug to us because
there is no way to now distinguish between absent data and data that should be lazily
loaded.
A sample project together with failing tests has been created on GitHub:
https://github.com/philiplowney/hibernate-max-fetch-depth-bug
(
https://hibernate.atlassian.net/browse/HHH-16871#add-comment?atlOrigin=ey...
) Add Comment (
https://hibernate.atlassian.net/browse/HHH-16871#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#100227- sha1:d7f1864 )