Hi, I believe this is an NH bug - hence why I'm asking here instead of the users group.
In production, we're seeing the following exception. NHibernate.MappingException: No persister for: StaffUserProxy (full stack trace below) I've not been able to repro this in a dev environment which clearly severely restricts my debugging ability. I've been stepping through NH and watching (normal) behavior as a StaffUserProxy passed in via the QueryParameters becomes a StaffUser EntityType associated entity. My feeling is there must be a bug somewhere in NH which incorrectly keeps it as a Proxy perhaps due to our use of lazy properties in this entity (the code worked before we added lazy properties). Any pointers to what I should look for would be most appreciated? NHibernate.MappingException: No persister for: StaffUserProxy at NHibernate.Impl.SessionFactoryImpl.GetEntityPersister(String entityName) at NHibernate.Impl.SessionFactoryImpl.GetIdentifierType(String className) at NHibernate.Type.EntityType.GetIdentifierType(IMapping factory) at NHibernate.Type.EntityType.GetIdentifierOrUniqueKeyType(IMapping factory) at NHibernate.Type.ManyToOneType.GetColumnSpan(IMapping mapping) at NHibernate.Param.AbstractExplicitParameterSpecification.GetParemeterSpan(IMapping sessionFactory) at NHibernate.Param.PositionalParameterSpecification.<GetIdsForBackTrack>d__0.MoveNext() at System.Linq.Enumerable.First[TSource](IEnumerable`1 source) at NHibernate.SqlCommand.SqlCommandImpl.ResetParametersIndexesForTheCommand(Int32 singleSqlParametersOffset) at NHibernate.Loader.Loader.PrepareQueryCommand(QueryParameters queryParameters, Boolean scroll, ISessionImplementor session) at NHibernate.Loader.Loader.DoQuery(ISessionImplementor session, QueryParameters queryParameters, Boolean returnProxies) at NHibernate.Loader.Loader.DoQueryAndInitializeNonLazyCollections(ISessionImplementor session, QueryParameters queryParameters, Boolean returnProxies) at NHibernate.Loader.Loader.DoList(ISessionImplementor session, QueryParameters queryParameters) at NHibernate.Loader.Loader.ListIgnoreQueryCache(ISessionImplementor session, QueryParameters queryParameters) at NHibernate.Loader.Loader.List(ISessionImplementor session, QueryParameters queryParameters, ISet`1 querySpaces, IType[] resultTypes) at NHibernate.Hql.Ast.ANTLR.Loader.QueryLoader.List(ISessionImplementor session, QueryParameters queryParameters) at NHibernate.Hql.Ast.ANTLR.QueryTranslatorImpl.List(ISessionImplementor session, QueryParameters queryParameters) at NHibernate.Engine.Query.HQLQueryPlan.PerformList(QueryParameters queryParameters, ISessionImplementor session, IList results) at NHibernate.Impl.SessionImpl.List(String query, QueryParameters queryParameters, IList results) at NHibernate.Impl.SessionImpl.List[T](String query, QueryParameters parameters) at NHibernate.Impl.QueryImpl.List[T]() Richard
