Skip to content

Commit

Permalink
HHH-17329 Resolve state for query cache for initialized proxies
Browse files Browse the repository at this point in the history
  • Loading branch information
mbladel authored and beikov committed Dec 1, 2023
1 parent 2570cbe commit fc5b184
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -506,6 +506,14 @@ protected void resolveEntityInstance(
}
else {
entityInstance = proxy;
if ( Hibernate.isInitialized( entityInstance ) ) {
this.isInitialized = true;
registerReloadedEntity( rowProcessingState, entityInstance );
if ( rowProcessingState.getQueryOptions().isResultCachingEnabled() == Boolean.TRUE ) {
// We need to read result set values to correctly populate the query cache
resolveState( rowProcessingState );
}
}
}
}
else {
Expand All @@ -518,7 +526,7 @@ protected void resolveEntityInstance(
registerReloadedEntity( rowProcessingState, existingEntity );
notifyResolutionListeners( entityInstance );
if ( rowProcessingState.getQueryOptions().isResultCachingEnabled() == Boolean.TRUE ) {
// We still need to read result set values to correctly populate the query cache
// We need to read result set values to correctly populate the query cache
resolveState( rowProcessingState );
}
}
Expand Down

0 comments on commit fc5b184

Please sign in to comment.