2

We've upgraded NHibernate from 2.xx to 3.3. It works well but we have some usages of

SetResultTransformer(new DistinctRootEntityResultTransformer())

And now we get "Index was outside the bounds of the array" exception when doing

.List<Entity>()

The Stack trace shows that the error comes from at NHibernate.Type.TypeHelper.Disassemble(Object[] row, ICacheAssembler[] types, Boolean[] nonCacheable, ISessionImplementor session, Object owner) at NHibernate.Cache.StandardQueryCache.Put(QueryKey key, ICacheAssembler[] returnTypes, IList result, Boolean isNaturalKeyLookup, ISessionImplementor session) at NHibernate.Loader.Loader.PutResultInQueryCache(ISessionImplementor session, QueryParameters queryParameters, IType[] resultTypes, IQueryCache queryCache, QueryKey key, IList result) at NHibernate.Loader.Loader.ListUsingQueryCache(ISessionImplementor session, QueryParameters queryParameters, ISet1 querySpaces, IType[] resultTypes) at NHibernate.Loader.Loader.List(ISessionImplementor session, QueryParameters queryParameters, ISet1 querySpaces, IType[] resultTypes) at NHibernate.Loader.Criteria.CriteriaLoader.List(ISessionImplementor session) at NHibernate.Impl.SessionImpl.List(CriteriaImpl criteria, IList results)

Any clues?

I found this: https://nhibernate.jira.com/browse/NH-2961

And if you remove, fetchmode.join or distinctrootentitytransformer or cache, it works.

4

0 回答 0