HHH-17826 ResultSet closed while scrolling results

This commit is contained in:
Andrea Boriero 2024-04-03 18:48:41 +02:00 committed by Andrea Boriero
parent 27a9ec209e
commit 239014db35
1 changed files with 9 additions and 5 deletions

View File

@ -129,16 +129,20 @@ public class ScrollableResultsImpl<R> extends AbstractScrollableResults<R> {
loadContexts.register( getJdbcValuesSourceProcessingState() );
persistenceContext.beforeLoad();
try {
currentRow = getRowReader().readRow( getRowProcessingState(), getProcessingOptions() );
try {
currentRow = getRowReader().readRow( getRowProcessingState(), getProcessingOptions() );
getRowProcessingState().finishRowProcessing();
getJdbcValuesSourceProcessingState().finishUp( false );
getRowProcessingState().finishRowProcessing( );
getJdbcValuesSourceProcessingState().finishUp( false );
}
finally {
persistenceContext.afterLoad();
}
persistenceContext.initializeNonLazyCollections();
}
finally {
persistenceContext.afterLoad();
loadContexts.deregister( getJdbcValuesSourceProcessingState() );
}
persistenceContext.initializeNonLazyCollections();
afterScrollOperation();
}