Skip to content
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

HHH-17783, HHH-17918 - Allow early initialization of entity instance by non-owning initializer #8149

Merged
merged 3 commits into from
Apr 12, 2024

Conversation

mbladel
Copy link
Member

@mbladel mbladel commented Apr 11, 2024

https://hibernate.atlassian.net/browse/HHH-17783
https://hibernate.atlassian.net/browse/HHH-17918

Alternative solution to #8110, including the reproducer kindly provided by @gtoison in #8136.

@mbladel
Copy link
Member Author

mbladel commented Apr 11, 2024

For reference: this change allows any entity initializer, even the "non-owning" one, i.e. not the one stored in the EntityHolder, to eagerly execute instance initialization if it gets to it first. This effectively moves the burden of initialization from the owning initializer to the first one that gets to actually initialize the entity. This also means we need some additional checks to avoid duplicating work.

@beikov
Copy link
Contributor

beikov commented Apr 12, 2024

Looks better than #8110. Great work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants