Skip to content

Commit d367418

Browse files
mbelladebeikov
authored andcommitted
HHH-17329 Resolve state for query cache for initialized proxies
1 parent 1737ee4 commit d367418

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

hibernate-core/src/main/java/org/hibernate/sql/results/graph/entity/AbstractEntityInitializer.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -519,6 +519,10 @@ protected void resolveEntityInstance(
519519
if ( Hibernate.isInitialized( entityInstance ) ) {
520520
this.isInitialized = true;
521521
registerReloadedEntity( rowProcessingState, holder );
522+
if ( rowProcessingState.getQueryOptions().isResultCachingEnabled() == Boolean.TRUE ) {
523+
// We need to read result set values to correctly populate the query cache
524+
resolveState( rowProcessingState );
525+
}
522526
}
523527
}
524528
}
@@ -532,7 +536,7 @@ protected void resolveEntityInstance(
532536
registerReloadedEntity( rowProcessingState, holder );
533537
notifyResolutionListeners( entityInstance );
534538
if ( rowProcessingState.getQueryOptions().isResultCachingEnabled() == Boolean.TRUE ) {
535-
// We still need to read result set values to correctly populate the query cache
539+
// We need to read result set values to correctly populate the query cache
536540
resolveState( rowProcessingState );
537541
}
538542
}

0 commit comments

Comments
 (0)