FutureValue fails on Linq queries defining a PostExecuteTransformer

Description

When a FutureValue has to call its ExecuteOnEval delegate, it fails with an unable to convert exception from a scalar/entity to a IQueryable of the scalar/entity.

Current 5.0.0 code base seems to affect ExecuteOnEval only when Value is obtained from First/FirstOrDefault/Single/SingleOrDefault, like in
session.Query<DomainClass>().Select(e => e.Id).ToFutureValue(q => q.FirstOrDefault()).Value
This is done by ProcessFirstOrSingleBase from ResultOperatorProcessors namespace. It defines a PostExecuteTransformer on the IntermediateHqlTree taking an IQueryable as input and yielding the scalar/entity as output. This transformer ends up affected to ExecuteOnEval.

But current implementation of FutureValue call ExecuteOnEval on a scalar/entity value instead of an IQueryable.

This trouble was discovered while attempting to solve NH-3850. (The solution I am working on for this other bug involves adding PostExecuteTransformer for scalar queries like Count/Min/Max/Sum, which has caused some FutureValue tests to start failing due to this bug with FutureValue and PostExecuteTransformer.)

Environment

None

Activity

Show:

Frédéric Delaporte February 22, 2017 at 1:33 AM
Edited

Well, rebasing my forked master was easy, but then rebasing my branch was yielding an ugly history, I have ended up merging. (I am not used to git.)

Pull request submited.

(And now history cleaned up, seems I found the way to do that.)

Frédéric Delaporte February 21, 2017 at 11:36 PM
Edited

Fix committed here.
I consider this as a prerequisite for solving NH-3850. Going to rebase/pull request.

Fixed

Details

Assignee

Reporter

Labels

Components

Fix versions

Affects versions

Priority

Who's Looking?

Open Who's Looking?

Created February 21, 2017 at 10:59 PM
Updated March 2, 2017 at 1:21 AM
Resolved March 1, 2017 at 7:46 AM
Who's Looking?