Skip to content

Commit

Permalink
Fix broken Session#refresh() method
Browse files Browse the repository at this point in the history
  • Loading branch information
dreab8 committed Jan 4, 2022
1 parent e27f6af commit 9c7d39a
Showing 1 changed file with 12 additions and 12 deletions.
Expand Up @@ -390,6 +390,18 @@ public void resolveInstance(RowProcessingState rowProcessingState) {
return;
}

final SharedSessionContractImplementor session = rowProcessingState
.getJdbcValuesSourceProcessingState()
.getSession();

final PersistenceContext persistenceContext = session.getPersistenceContext();
// Special case map proxy to avoid stack overflows
// We know that a map proxy will always be of "the right type" so just use that object
final LoadingEntityEntry existingLoadingEntry = persistenceContext
.getLoadContexts()
.findLoadingEntityEntry( entityKey );
setIsOwningInitializer( entityKey.getIdentifier(), existingLoadingEntry );

if ( entityInstance != null ) {
return;
}
Expand All @@ -405,19 +417,7 @@ public void resolveInstance(RowProcessingState rowProcessingState) {
);
}

final SharedSessionContractImplementor session = rowProcessingState
.getJdbcValuesSourceProcessingState()
.getSession();

final PersistenceContext persistenceContext = session.getPersistenceContext();
final Object proxy = getProxy( persistenceContext );
// Special case map proxy to avoid stack overflows
// We know that a map proxy will always be of "the right type" so just use that object
final LoadingEntityEntry existingLoadingEntry = persistenceContext
.getLoadContexts()
.findLoadingEntityEntry( entityKey );
setIsOwningInitializer(entityKey.getIdentifier(), existingLoadingEntry );

final Object entityInstanceFromExecutionContext = rowProcessingState.getJdbcValuesSourceProcessingState()
.getExecutionContext()
.getEntityInstance();
Expand Down

0 comments on commit 9c7d39a

Please sign in to comment.