When an association gets loaded eagerly by \{\{StatelessSessionImpl#internalLoad}} calling \{\{StatelessSessionImpl#get}}, \{\{temporaryPersistenceContext}} may get cleared before the load is complete. If this happens, Hibernate will not find an expected \{\{EntityEntry}}, and \{\{TwoPhaseLoad#afterInitialize}} will throw a \{\{NullPointerException}}.
The test case for [https://hibernate.atlassian.net/browse/HHH-13633|https://hibernate.atlassian.net/browse/HHH-13633|smart-link] caused the \{\{NullPointerException}} because there was a bug that caused a lazy association to be loaded eagerly. Once that bug was fixed by HHH-13633, the problem was no longer reproduced by that test case.
Modifying that test case to make the association eager reproduced this issue again.
----
Original description:
A test case added for [ HHH-13633 ] throws {{NullPointerException}}.
[~accountid:557058:57b78197-578e-4af9-9e41-2519cf70478f] found that this [commit|https://github.com/hibernate/hibernate-orm/commit/3fec3b930b78a702f34b5f0c6f5ad6ae6d694d1d] for [ HHH-12425 ] caused the NPE. |
|