Move persistence context access in EntitySelectFetchInitializer to fix PostgreSQL issues
This commit is contained in:
parent
7f1a60c4c6
commit
604cef2cb6
|
@ -123,6 +123,12 @@ public class EntitySelectFetchInitializer extends AbstractFetchParentAccess impl
|
|||
|
||||
final EntityKey entityKey = new EntityKey( entityIdentifier, concreteDescriptor );
|
||||
|
||||
final PersistenceContext persistenceContext = session.getPersistenceContextInternal();
|
||||
entityInstance = persistenceContext.getEntity( entityKey );
|
||||
if ( entityInstance != null ) {
|
||||
return;
|
||||
}
|
||||
|
||||
Initializer initializer = rowProcessingState.getJdbcValuesSourceProcessingState().findInitializer(
|
||||
entityKey );
|
||||
|
||||
|
@ -140,12 +146,6 @@ public class EntitySelectFetchInitializer extends AbstractFetchParentAccess impl
|
|||
return;
|
||||
}
|
||||
|
||||
final PersistenceContext persistenceContext = session.getPersistenceContextInternal();
|
||||
entityInstance = persistenceContext.getEntity( entityKey );
|
||||
if ( entityInstance != null ) {
|
||||
return;
|
||||
}
|
||||
|
||||
final LoadingEntityEntry existingLoadingEntry = session
|
||||
.getPersistenceContext()
|
||||
.getLoadContexts()
|
||||
|
|
Loading…
Reference in New Issue