mirror of
https://github.com/hibernate/hibernate-orm
synced 2025-02-09 12:44:49 +00:00
HHH-16106 Using BatchEntitySelectFetchInitializer causes PostLoad to be called before references are initialized
This commit is contained in:
parent
10458da711
commit
6c385f7890
@ -163,13 +163,6 @@ public SharedSessionContractImplementor getSession() {
|
||||
|
||||
@Override
|
||||
public void finishUp() {
|
||||
// for arrays, we should end the collection load beforeQuery resolving the entities, since the
|
||||
// actual array instances are not instantiated during loading
|
||||
finishLoadingArrays();
|
||||
|
||||
// now finish loading the entities (2-phase load)
|
||||
performTwoPhaseLoad();
|
||||
|
||||
// now we can finalize loading collections
|
||||
finishLoadingCollections();
|
||||
|
||||
@ -207,22 +200,6 @@ private void postLoad() {
|
||||
loadingEntityMap = null;
|
||||
}
|
||||
|
||||
private void finishLoadingArrays() {
|
||||
if ( arrayInitializers != null ) {
|
||||
for ( CollectionInitializer collectionInitializer : arrayInitializers ) {
|
||||
collectionInitializer.endLoading( executionContext );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void performTwoPhaseLoad() {
|
||||
if ( loadingEntityMap == null ) {
|
||||
return;
|
||||
}
|
||||
log.tracev( "Total objects hydrated: {0}", loadingEntityMap.size() );
|
||||
}
|
||||
|
||||
@SuppressWarnings("SimplifiableIfStatement")
|
||||
private boolean isReadOnly() {
|
||||
if ( getQueryOptions().isReadOnly() != null ) {
|
||||
|
@ -201,6 +201,7 @@ else if ( this.uniqueSemantic == UniqueSemantic.ASSERT ) {
|
||||
}
|
||||
|
||||
try {
|
||||
rowReader.finishUp( jdbcValuesSourceProcessingState );
|
||||
jdbcValuesSourceProcessingState.finishUp();
|
||||
}
|
||||
finally {
|
||||
@ -220,7 +221,7 @@ else if ( this.uniqueSemantic == UniqueSemantic.ASSERT ) {
|
||||
}
|
||||
finally {
|
||||
try {
|
||||
rowReader.finishUp( jdbcValuesSourceProcessingState );
|
||||
|
||||
jdbcValues.finishUp( session );
|
||||
persistenceContext.initializeNonLazyCollections();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user