Dixson Huie (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
) *created* an issue
Hibernate ORM (
https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiZGZmYTQxY2E0...
) / Bug (
https://hibernate.atlassian.net/browse/HHH-15506?atlOrigin=eyJpIjoiZGZmYT...
) HHH-15506 (
https://hibernate.atlassian.net/browse/HHH-15506?atlOrigin=eyJpIjoiZGZmYT...
) FetchType.EAGER ignored when using query.scroll (
https://hibernate.atlassian.net/browse/HHH-15506?atlOrigin=eyJpIjoiZGZmYT...
)
Issue Type: Bug Affects Versions: 5.6.11 Assignee: Unassigned Attachments:
HibernateEagerTypeDemo.zip Components: hibernate-core Created: 13/Sep/2022 12:18 PM
Environment: Tested with Hibernate core 5.6.x, JVM Java 11, Hibernate, mysql and hsql.
Priority: Critical Reporter: Dixson Huie (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
)
When FetchType.EAGER is specified to retrieve embedded objects, it seems to be treated as
LAZY. In other words, initial retrieval of the object does retrieve the embedded objects,
it’s only when you try to read the embedded attribute, getXYZ(), it goes back to Hibernate
and to retrieve it because it is behaving in a LAZY manner.
It seems to happen only when query.scroll() is used and not when session.get() is used.
Version 5.3.10 works. Later versions of 5.3.x seem to work differently. 5.6 seems to have
the issue.
Expectation: When FetchType.EAGER is specified, it should retrieve the object and its
embedded objects.
What happens: Only non-embedded attributes are retrieved and embedded objects are lazily
initialized.
Please see attached test.
(
https://hibernate.atlassian.net/browse/HHH-15506#add-comment?atlOrigin=ey...
) Add Comment (
https://hibernate.atlassian.net/browse/HHH-15506#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#100206- sha1:821f494 )