HHH-18085 Also remove loading holder when loading shallow cached entity

This commit is contained in:
Marco Belladelli 2024-05-28 13:17:41 +02:00
parent 06f301f463
commit a86b35e664
1 changed files with 1 additions and 0 deletions

View File

@ -944,6 +944,7 @@ public class EntityInitializerImpl extends AbstractInitializer<EntityInitializer
assert data.entityHolder.getEntityInitializer() == this; assert data.entityHolder.getEntityInitializer() == this;
// If this initializer owns the entity, we have to remove the entity holder, // If this initializer owns the entity, we have to remove the entity holder,
// because the subsequent loading process will claim the entity // because the subsequent loading process will claim the entity
rowProcessingState.getJdbcValuesSourceProcessingState().getLoadingEntityHolders().remove( data.entityHolder );
session.getPersistenceContextInternal().removeEntityHolder( data.entityKey ); session.getPersistenceContextInternal().removeEntityHolder( data.entityKey );
return session.internalLoad( return session.internalLoad(
data.concreteDescriptor.getEntityName(), data.concreteDescriptor.getEntityName(),