NHibernate.QueryException与动态组件 [英] NHibernate.QueryException with dynamic-component

查看:137
本文介绍了NHibernate.QueryException与动态组件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好吧,这将是一个长期的尝试,因为它是一个大型系统(到目前为止,我还没有完全了解它),问题可能不在于NHibernate本身,我什至无法复制它,但是...

OK, this is going to be kind of a long shot, since it's a big system (which I don't claim to fully understand, yet), and the problem might not be with NHibernate itself, and I'm even having trouble reproducing it, but...

我有一个带有< dynamic-component>节的类,当我在其上运行查询(通过ASP.NET MVC应用程序)时,它失败了,但仅在某些情况下会失败. (是的,最糟糕的一种!)

I've got a class with a <dynamic-component> section, and when I run a query on it (through my ASP.NET MVC app), it fails, but only sometimes. (Yeah, the worst kind!)

我看到的异常是:

NHibernate.QueryException: could not resolve property:
Attributes.MyAttributeName of: MyClassName
   at NHibernate.Persister.Entity.AbstractPropertyMapping.GetColumns(String propertyName)
   at NHibernate.Persister.Entity.AbstractPropertyMapping.ToColumns(String alias, String propertyName)
   at NHibernate.Persister.Entity.BasicEntityPropertyMapping.ToColumns(String alias, String propertyName)
   at NHibernate.Persister.Entity.AbstractEntityPersister.ToColumns(String alias, String propertyName)
   at NHibernate.Loader.Criteria.CriteriaQueryTranslator.GetColumns(String propertyName, ICriteria subcriteria)
   at NHibernate.Loader.Criteria.CriteriaQueryTranslator.GetColumnsUsingProjection(ICriteria subcriteria, String propertyName)
   at NHibernate.Criterion.CriterionUtil.GetColumnNamesUsingPropertyName(ICriteriaQuery criteriaQuery, ICriteria criteria, String propertyName, Object value, ICriterion critertion)
   at NHibernate.Criterion.CriterionUtil.GetColumnNamesForSimpleExpression(String propertyName, IProjection projection, ICriteriaQuery criteriaQuery, ICriteria criteria, IDictionary`2 enabledFilters, ICriterion criterion, Object value)
   at NHibernate.Criterion.SimpleExpression.ToSqlString(ICriteria criteria, ICriteriaQuery criteriaQuery, IDictionary`2 enabledFilters)
   at NHibernate.Loader.Criteria.CriteriaQueryTranslator.GetWhereCondition(IDictionary`2 enabledFilters)
   at NHibernate.Loader.Criteria.CriteriaJoinWalker..ctor(IOuterJoinLoadable persister, CriteriaQueryTranslator translator, ISessionFactoryImplementor factory, CriteriaImpl criteria, String rootEntityName, IDictionary`2 enabledFilters)
   at NHibernate.Loader.Criteria.CriteriaLoader..ctor(IOuterJoinLoadable persister, ISessionFactoryImplementor factory, CriteriaImpl rootCriteria, String rootEntityName, IDictionary`2 enabledFilters)
   at NHibernate.Impl.SessionImpl.List(CriteriaImpl criteria, IList results)
   at NHibernate.Impl.CriteriaImpl.List(IList results)
   at NHibernate.Impl.CriteriaImpl.UniqueResult[T]()
...my code below here...

任何人都可以确切解释此QueryException的含义,也就是说,我可以对它认为到底出了什么问题有所了解吗?

Can anybody explain exactly what this QueryException means, i.e., so I can have an idea of what exactly it thinks is going wrong?

谢谢!

推荐答案

事实证明,我的问题仅在NHibernate之外,而这仅仅是实际问题的最直接症状.

It turns out my problem was just outside of NHibernate, and this was just the most direct symptom of the actual problem.

(我会描述一个真正的问题,但是细节对其他人并没有那么有趣或没有帮助.除了说:缓存非常有用,每个人,除非您犯了错并且他们没有这样做.退还他们应该做的事情!)

(I'd describe the real problem, but the details wouldn't really be that interesting or helpful to other people. Except to say that: caches are pretty useful, everybody, except when you make a mistake and they don't return the thing they should!)

我试图关闭此问题,但我只是看到关闭/重新打开期间发生问题"弹出窗口,因此假装它已关闭.

I tried to close this question, but I just get the "A problem occurred during closing/reopening" popup, so just pretend it got closed.

这篇关于NHibernate.QueryException与动态组件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆