Skip to content

Conversation

marko-bekhta
Copy link
Member

https://hibernate.atlassian.net/browse/HHH-19857
https://hibernate.atlassian.net/browse/HHH-19856

test cases for the issues ^ + a possible fix for a HHH-19857

Issues are caused by changes made for HHH-19805


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license
and can be relicensed under the terms of the LGPL v2.1 license in the future at the maintainers' discretion.
For more information on licensing, please check here.


@marko-bekhta marko-bekhta force-pushed the bug/HHH-19856-lazy-problems branch from ec28dc2 to 27b0110 Compare October 10, 2025 15:13
Comment on lines -1608 to +1610
final Set<String> initializedLazyAttributeNames = interceptor.getInitializedLazyAttributeNames();
// Create a copy of init attrs, since lazySelectLoadPlan.load may update the set inside the interceptor,
// and we end up with the modified one here:
final Set<String> initializedLazyAttributeNames = new HashSet<>( interceptor.getInitializedLazyAttributeNames() );
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this might be only "hiding" the problem: we don't want this method to ignore the lazy attribute interceptor's initialized attributes set, as they might be read by other logic (e.g. field writes) instead of explicitly by this method.

I tried looking into this, and the lazySelectLoadPlan.load() call seems to be doing just that, so I believe a better fix would be adapting the for loop that iterates through the lazy-group attributes to account for that.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏻 if you'll be looking into this, let's push that set variable initialization waaaaaaaaaaaaaay down after the lazySelectLoadPlan.load. Because as the things are atm it's confusing at best, that the initializedLazyAttributeNames changes mid method 🙂

@mbellade
Copy link
Member

Thanks @marko-bekhta for looking into this one. As for the failing test, I believe that might be intended, I've tried explaining what I think is happening on the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants