HHH-17526 Throw correct exception when reading list results
This commit is contained in:
parent
ea90b86f9f
commit
84726a5772
|
@ -152,10 +152,9 @@ public class ListResultsConsumer<R> implements ResultsConsumer<List<R>, R> {
|
||||||
final TypeConfiguration typeConfiguration = session.getTypeConfiguration();
|
final TypeConfiguration typeConfiguration = session.getTypeConfiguration();
|
||||||
final QueryOptions queryOptions = rowProcessingState.getQueryOptions();
|
final QueryOptions queryOptions = rowProcessingState.getQueryOptions();
|
||||||
RuntimeException ex = null;
|
RuntimeException ex = null;
|
||||||
|
persistenceContext.beforeLoad();
|
||||||
|
persistenceContext.getLoadContexts().register( jdbcValuesSourceProcessingState );
|
||||||
try {
|
try {
|
||||||
persistenceContext.beforeLoad();
|
|
||||||
persistenceContext.getLoadContexts().register( jdbcValuesSourceProcessingState );
|
|
||||||
|
|
||||||
final JavaType<R> domainResultJavaType = resolveDomainResultJavaType(
|
final JavaType<R> domainResultJavaType = resolveDomainResultJavaType(
|
||||||
rowReader.getDomainResultResultJavaType(),
|
rowReader.getDomainResultResultJavaType(),
|
||||||
rowReader.getResultJavaTypes(),
|
rowReader.getResultJavaTypes(),
|
||||||
|
@ -207,13 +206,8 @@ public class ListResultsConsumer<R> implements ResultsConsumer<List<R>, R> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
rowReader.finishUp( jdbcValuesSourceProcessingState );
|
||||||
rowReader.finishUp( jdbcValuesSourceProcessingState );
|
jdbcValuesSourceProcessingState.finishUp( readRows > 1 );
|
||||||
jdbcValuesSourceProcessingState.finishUp( readRows > 1 );
|
|
||||||
}
|
|
||||||
finally {
|
|
||||||
persistenceContext.getLoadContexts().deregister( jdbcValuesSourceProcessingState );
|
|
||||||
}
|
|
||||||
|
|
||||||
//noinspection unchecked
|
//noinspection unchecked
|
||||||
final ResultListTransformer<R> resultListTransformer =
|
final ResultListTransformer<R> resultListTransformer =
|
||||||
|
@ -231,6 +225,7 @@ public class ListResultsConsumer<R> implements ResultsConsumer<List<R>, R> {
|
||||||
try {
|
try {
|
||||||
jdbcValues.finishUp( session );
|
jdbcValues.finishUp( session );
|
||||||
persistenceContext.afterLoad();
|
persistenceContext.afterLoad();
|
||||||
|
persistenceContext.getLoadContexts().deregister( jdbcValuesSourceProcessingState );
|
||||||
persistenceContext.initializeNonLazyCollections();
|
persistenceContext.initializeNonLazyCollections();
|
||||||
}
|
}
|
||||||
catch (RuntimeException e) {
|
catch (RuntimeException e) {
|
||||||
|
|
Loading…
Reference in New Issue