From: Daniel G. (JIRA) <nh...@gm...> - 2011-04-20 23:33:35
|
[ http://216.121.112.228/browse/NH-2658?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=20929#action_20929 ] Daniel Guenter commented on NH-2658: ------------------------------------ I have a patch (HG) which solves this issue. https://bitbucket.org/nicaog/nhibernate-patches/changeset/8ea3eb358e61 However it does introduce a new concept into the system. IHqlGenerator(s) are allowed to participate in the initial building of the expression tree and key through the use of a SpecialMemberVisitor and a new interface method called Visit. This allows for expression replacing and parameter manipulation before the expression key is finalized. This solution may be a bit more intrusive than I had hoped it would be. However it does allow for more advanced and intelligent hql generators. > Linq provider overcaching HQL > ----------------------------- > > Key: NH-2658 > URL: http://216.121.112.228/browse/NH-2658 > Project: NHibernate > Issue Type: Bug > Components: Linq Provider > Affects Versions: 3.1.0 > Reporter: Daniel Guenter > Priority: Major > Attachments: NH2658_failing_test_case.patch > > > The linq provider caches a query assuming that ALL constants will be turned into HQL parameters. Sometimes this is not the case. A linq extension that selects a concrete entity property based on a constant value will never pass that value into HQL. > This is also a blocking issue in getting Linq to work with dynamic-components. The string value passed into the dictionary (dict["key"] == x) cannot be passed to HQL as a parameter as it is directly evaluating a property name. Thus the first query will work but subsequent queries will be wrong and will reuse the column/property name of the first cached query. -- 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 |