HHH-9784 - Scroll method does not support provided HQLQueryPlan

(cherry picked from commit be40ccf9cc)
This commit is contained in:
Steve Ebersole 2015-10-26 18:59:27 -05:00
parent 4fcb465311
commit 7fba0e731e
1 changed files with 8 additions and 2 deletions

View File

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