Uploaded image for project: 'NHibernate [Moved to GitHub]'
  1. NH-3950

FutureValue fails on Linq queries defining a PostExecuteTransformer

    Details

    • Sprint:

      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 Resolved . (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.)

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              fdelaporte Frédéric Delaporte
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Who's Looking?