-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Always instantiate Hibernate ORM collections in the default fetch group #27666
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
Always instantiate Hibernate ORM collections in the default fetch group #27666
Conversation
3dc26d7
to
33cc9d0
Compare
Cool. Is this going to make it into Quarkus 2.12.1 ? |
I'm not sure that would be wise... It's a rather significant change, and could have a (small) performance impact. @Sanne, any opinion on that? |
I'd prefer it to be limited to the next minor but I have no strong opinion. |
FWIW I submitted a PR (hibernate/hibernate-orm#5252) to make this the default in Hibernate ORM 6.2. I hade to change a few tests though; and that won't become the default in 5.x (which Quarkus currently uses, and will use until we migrate to Jakarta EE). This is a rather complex situation, so I'll discuss with @gsmet when/where he thinks it would be best to merge this. |
…n tests It was acceptable before we fixed HHH-14620, but now that initializing a property doesn't imply initializing the collection, it's just plain wrong.
33cc9d0
to
2f77645
Compare
... be it for Hibernate Reactive (as before) or for Hibernate ORM.
Fixes #27657
Fixes #4644 (according to #27657 (reply in thread))
Fixes problems such as #27657, where calling a getter to retrieve a collection on an initialized entity would throw a
LazyInitializationException
, whereas one would expect the exception to be thrown later, when accessing the collection itself (.size()
,.iterator()
, ...).This sets defaults as suggested by @gavinking and @Sanne when the option was introduced some time ago: hibernate/hibernate-orm#3558 (comment), hibernate/hibernate-orm#3558 (comment)