HHH-9784 Scroll method does not support provided HQLQueryPlan

(cherry picked from commit 09127bf1c3)
This commit is contained in:
reda-alaoui 2015-05-10 20:47:27 +02:00 committed by Steve Ebersole
parent 3da8d8542f
commit 4fcb465311
1 changed files with 6 additions and 1 deletions

View File

@ -1344,7 +1344,12 @@ public final class SessionImpl extends AbstractSessionImpl implements EventSourc
public ScrollableResults scroll(String query, QueryParameters queryParameters) throws HibernateException {
errorIfClosed();
checkTransactionSynchStatus();
HQLQueryPlan plan = getHQLQueryPlan( query, false );
HQLQueryPlan plan = queryParameters.getQueryPlan();
if (plan == null) {
plan = getHQLQueryPlan( query, false );
}
autoFlushIfRequired( plan.getQuerySpaces() );
dontFlushFromFind++;
try {