HHH-9784 Scroll method does not support provided HQLQueryPlan

This commit is contained in:
reda-alaoui 2015-05-10 20:47:27 +02:00 committed by Steve Ebersole
parent 1677e0662b
commit 09127bf1c3
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 { public ScrollableResults scroll(String query, QueryParameters queryParameters) throws HibernateException {
errorIfClosed(); errorIfClosed();
checkTransactionSynchStatus(); checkTransactionSynchStatus();
HQLQueryPlan plan = getHQLQueryPlan( query, false );
HQLQueryPlan plan = queryParameters.getQueryPlan();
if (plan == null) {
plan = getHQLQueryPlan( query, false );
}
autoFlushIfRequired( plan.getQuerySpaces() ); autoFlushIfRequired( plan.getQuerySpaces() );
dontFlushFromFind++; dontFlushFromFind++;
try { try {