|
From: Michael H. (JIRA) <nh...@gm...> - 2010-11-23 06:03:27
|
ToFuture throws NotSupportedException on IQueryable if Fetch is used.
---------------------------------------------------------------------
Key: NH-2422
URL: http://216.121.112.228/browse/NH-2422
Project: NHibernate
Issue Type: Bug
Components: Linq Provider
Affects Versions: 3.0.0.CR1
Reporter: Michael Hart
Priority: Major
If a Fetch call is added to an NHibernate LINQ query, a NotSupportedException is thrown as the type is no longer an NhQueryable but rather an NhFetchRequest - however, both types extend QueryableBase.
ie, this works:
var result = ses.Query<Child>()
.ToFuture();
But this throws a NotSupportedException:
var result = ses.Query<Child>()
.Fetch(x => x.Parent)
.ToFuture();
This makes the ToFuture and ToFutureValue methods of limited use in a production system where eager fetching is necessary.
It also reduces the flexibility to modify queries from being lazy loading (or whatever the default is), to adding eager loading later. If an application has been written using futures and lazy loading, then it is non-trivial to add eager fetching as any futures semantics and logic must also be rewritten.
I believe ToFuture should be modified to test and cast the query as a QueryableBase instead of an NhQueryable.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://216.121.112.228/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
|
|
From: Kelly S. (JIRA) <nh...@gm...> - 2011-05-10 18:32:12
|
[ http://216.121.112.228/browse/NH-2422?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=21040#action_21040 ]
Kelly Stuard commented on NH-2422:
----------------------------------
I am also having this issue in [3.1.0.4000] and will be happy to produce a test for this, if needed/desired.
> ToFuture throws NotSupportedException on IQueryable if Fetch is used.
> ---------------------------------------------------------------------
>
> Key: NH-2422
> URL: http://216.121.112.228/browse/NH-2422
> Project: NHibernate
> Issue Type: Bug
> Components: Linq Provider
> Affects Versions: 3.0.0.CR1
> Reporter: Michael Hart
> Priority: Major
>
> If a Fetch call is added to an NHibernate LINQ query, a NotSupportedException is thrown as the type is no longer an NhQueryable but rather an NhFetchRequest - however, both types extend QueryableBase.
> ie, this works:
> var result = ses.Query<Child>()
> .ToFuture();
> But this throws a NotSupportedException:
> var result = ses.Query<Child>()
> .Fetch(x => x.Parent)
> .ToFuture();
> This makes the ToFuture and ToFutureValue methods of limited use in a production system where eager fetching is necessary.
> It also reduces the flexibility to modify queries from being lazy loading (or whatever the default is), to adding eager loading later. If an application has been written using futures and lazy loading, then it is non-trivial to add eager fetching as any futures semantics and logic must also be rewritten.
> I believe ToFuture should be modified to test and cast the query as a QueryableBase instead of an NhQueryable.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://216.121.112.228/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
|
|
From: Andrei A. (JIRA) <nh...@gm...> - 2011-05-11 11:01:04
|
[ http://216.121.112.228/browse/NH-2422?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=21049#action_21049 ]
Andrei Alecu commented on NH-2422:
----------------------------------
Also see NH-2690 which I believe is related as the cast to QueryableBase<T> results in a different error that occurs under other circumstances.
> ToFuture throws NotSupportedException on IQueryable if Fetch is used.
> ---------------------------------------------------------------------
>
> Key: NH-2422
> URL: http://216.121.112.228/browse/NH-2422
> Project: NHibernate
> Issue Type: Bug
> Components: Linq Provider
> Affects Versions: 3.0.0.CR1
> Reporter: Michael Hart
> Priority: Major
>
> If a Fetch call is added to an NHibernate LINQ query, a NotSupportedException is thrown as the type is no longer an NhQueryable but rather an NhFetchRequest - however, both types extend QueryableBase.
> ie, this works:
> var result = ses.Query<Child>()
> .ToFuture();
> But this throws a NotSupportedException:
> var result = ses.Query<Child>()
> .Fetch(x => x.Parent)
> .ToFuture();
> This makes the ToFuture and ToFutureValue methods of limited use in a production system where eager fetching is necessary.
> It also reduces the flexibility to modify queries from being lazy loading (or whatever the default is), to adding eager loading later. If an application has been written using futures and lazy loading, then it is non-trivial to add eager fetching as any futures semantics and logic must also be rewritten.
> I believe ToFuture should be modified to test and cast the query as a QueryableBase instead of an NhQueryable.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://216.121.112.228/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
|
|
From: Fabio M. (JIRA) <nh...@gm...> - 2011-05-12 16:28:19
|
[ http://216.121.112.228/browse/NH-2422?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Fabio Maulo resolved NH-2422.
-----------------------------
Resolution: Fixed
Fix Version/s: 3.2.0Beta1
> ToFuture throws NotSupportedException on IQueryable if Fetch is used.
> ---------------------------------------------------------------------
>
> Key: NH-2422
> URL: http://216.121.112.228/browse/NH-2422
> Project: NHibernate
> Issue Type: Bug
> Components: Linq Provider
> Affects Versions: 3.0.0.CR1
> Reporter: Michael Hart
> Priority: Major
> Fix For: 3.2.0Beta1
>
>
> If a Fetch call is added to an NHibernate LINQ query, a NotSupportedException is thrown as the type is no longer an NhQueryable but rather an NhFetchRequest - however, both types extend QueryableBase.
> ie, this works:
> var result = ses.Query<Child>()
> .ToFuture();
> But this throws a NotSupportedException:
> var result = ses.Query<Child>()
> .Fetch(x => x.Parent)
> .ToFuture();
> This makes the ToFuture and ToFutureValue methods of limited use in a production system where eager fetching is necessary.
> It also reduces the flexibility to modify queries from being lazy loading (or whatever the default is), to adding eager loading later. If an application has been written using futures and lazy loading, then it is non-trivial to add eager fetching as any futures semantics and logic must also be rewritten.
> I believe ToFuture should be modified to test and cast the query as a QueryableBase instead of an NhQueryable.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://216.121.112.228/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
|