Skip to content

Future queries not executed if no support for multiple queries #1663

@StormimOn

Description

@StormimOn

NHibernate 5.X did change a little the Future extensions methods.
This cause a regression if there is no support for multiple queries, because in some scenarios the future queries won't be called.

For example

var query = Session.QueryOver<ParentObject>()....Future<ParentObject>();
Session.QueryOver<ParentObject>().Fetch(x => x.ChildCollection1)....Future<ParentObject>();
Session.QueryOver<ParentObject>().Fetch(x => x.ChildCollection2)....Future<ParentObject>();
...
Session.QueryOver<ParentObject>().Fetch(x => x.ChildCollectionN)....Future<ParentObject>();

var result = query.SingleOrDefault();

In this case the queries fetching childs collections won't be called.
With NH 3.X the .Future() would react like a .List() so there was no problem.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions