HHH-9784 - Scroll method does not support provided HQLQueryPlan

This commit is contained in:
Steve Ebersole 2015-10-26 18:59:27 -05:00
parent 09127bf1c3
commit be40ccf9cc
1 changed files with 8 additions and 2 deletions

View File

@ -1327,7 +1327,12 @@ public final class SessionImpl extends AbstractSessionImpl implements EventSourc
errorIfClosed();
checkTransactionSynchStatus();
queryParameters.validateParameters();
HQLQueryPlan plan = getHQLQueryPlan( query, true );
HQLQueryPlan plan = queryParameters.getQueryPlan();
if ( plan == null ) {
plan = getHQLQueryPlan( query, true );
}
autoFlushIfRequired( plan.getQuerySpaces() );
dontFlushFromFind++; //stops flush being called multiple times if this method is recursively called
@ -1346,11 +1351,12 @@ public final class SessionImpl extends AbstractSessionImpl implements EventSourc
checkTransactionSynchStatus();
HQLQueryPlan plan = queryParameters.getQueryPlan();
if (plan == null) {
if ( plan == null ) {
plan = getHQLQueryPlan( query, false );
}
autoFlushIfRequired( plan.getQuerySpaces() );
dontFlushFromFind++;
try {
return plan.performScroll( queryParameters, this );