mirror of
https://github.com/hibernate/hibernate-orm
synced 2025-02-17 00:24:57 +00:00
Fix ScrollableResultsImpl not initializing non lazy collections
This commit is contained in:
parent
ba5d90d116
commit
3aa875b037
@ -127,6 +127,11 @@ private void prepareCurrentRow(boolean underlyingScrollSuccessful) {
|
|||||||
getProcessingOptions()
|
getProcessingOptions()
|
||||||
);
|
);
|
||||||
|
|
||||||
|
getRowProcessingState().finishRowProcessing();
|
||||||
|
getJdbcValuesSourceProcessingState().finishUp();
|
||||||
|
|
||||||
|
getRowProcessingState().getSession().getPersistenceContext().initializeNonLazyCollections();
|
||||||
|
|
||||||
afterScrollOperation();
|
afterScrollOperation();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -16,9 +16,7 @@
|
|||||||
import org.hibernate.engine.spi.EntityKey;
|
import org.hibernate.engine.spi.EntityKey;
|
||||||
import org.hibernate.engine.spi.SharedSessionContractImplementor;
|
import org.hibernate.engine.spi.SharedSessionContractImplementor;
|
||||||
import org.hibernate.event.service.spi.EventListenerGroup;
|
import org.hibernate.event.service.spi.EventListenerGroup;
|
||||||
import org.hibernate.event.service.spi.EventListenerRegistry;
|
|
||||||
import org.hibernate.event.spi.EventSource;
|
import org.hibernate.event.spi.EventSource;
|
||||||
import org.hibernate.event.spi.EventType;
|
|
||||||
import org.hibernate.event.spi.PostLoadEvent;
|
import org.hibernate.event.spi.PostLoadEvent;
|
||||||
import org.hibernate.event.spi.PostLoadEventListener;
|
import org.hibernate.event.spi.PostLoadEventListener;
|
||||||
import org.hibernate.event.spi.PreLoadEvent;
|
import org.hibernate.event.spi.PreLoadEvent;
|
||||||
@ -164,7 +162,6 @@ public SharedSessionContractImplementor getSession() {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void finishUp() {
|
public void finishUp() {
|
||||||
try {
|
|
||||||
// for arrays, we should end the collection load beforeQuery resolving the entities, since the
|
// for arrays, we should end the collection load beforeQuery resolving the entities, since the
|
||||||
// actual array instances are not instantiated during loading
|
// actual array instances are not instantiated during loading
|
||||||
finishLoadingArrays();
|
finishLoadingArrays();
|
||||||
@ -177,10 +174,6 @@ public void finishUp() {
|
|||||||
|
|
||||||
postLoad();
|
postLoad();
|
||||||
}
|
}
|
||||||
finally {
|
|
||||||
executionContext.getSession().getPersistenceContext().getLoadContexts().deregister( this );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void postLoad() {
|
private void postLoad() {
|
||||||
if ( loadingEntityMap == null ) {
|
if ( loadingEntityMap == null ) {
|
||||||
@ -209,6 +202,7 @@ private void postLoad() {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
loadingEntityMap = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void finishLoadingArrays() {
|
private void finishLoadingArrays() {
|
||||||
@ -247,7 +241,7 @@ private void finishLoadingCollections() {
|
|||||||
loadingCollectionEntry.finishLoading( getExecutionContext() );
|
loadingCollectionEntry.finishLoading( getExecutionContext() );
|
||||||
}
|
}
|
||||||
|
|
||||||
loadingCollectionMap.clear();
|
loadingCollectionMap = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -114,7 +114,13 @@ public List<R> consume(
|
|||||||
rowProcessingState.finishRowProcessing();
|
rowProcessingState.finishRowProcessing();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
try {
|
||||||
jdbcValuesSourceProcessingState.finishUp();
|
jdbcValuesSourceProcessingState.finishUp();
|
||||||
|
}
|
||||||
|
finally {
|
||||||
|
persistenceContext.getLoadContexts().deregister( jdbcValuesSourceProcessingState );
|
||||||
|
}
|
||||||
|
|
||||||
return results;
|
return results;
|
||||||
}
|
}
|
||||||
finally {
|
finally {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user