thanks, I was able to avoid the exception by removing my SetCache() .. & SetCacheRegion() calls.
Where should I keep checking to know when the latest release is stable? On Jul 24, 7:04 pm, Craig van Nieuwkerk <[email protected]> wrote: > More infohttps://nhibernate.jira.com/browse/NH-1090 > > On Mon, Jul 25, 2011 at 9:03 AM, Craig van Nieuwkerk <[email protected]>wrote: > > > > > I think this is fixed in NH 3.2 (to be released shortly). > > > [NH-1090] - Query cache does not work when using Criteria API to create a > > projection query with a result transformer > > > Craig > > > On Mon, Jul 25, 2011 at 3:59 AM, fel0niousmonk <[email protected]>wrote: > > >> I'm getting the following error: > > >> System.InvalidCastException occurred > >> Message=Unable to cast object of type > >> 'AEGISweb.Data.Entities.TechSupportCallback' to type > >> 'System.Object[]'. > >> Source=NHibernate > >> StackTrace: > >> at NHibernate.Cache.StandardQueryCache.Put(QueryKey key, > >> ICacheAssembler[] returnTypes, IList result, Boolean > >> isNaturalKeyLookup, ISessionImplementor session) > >> InnerException: > > >> with a query + projection like: > > >> // open session & transaction in using (..) > >> // only return the properties we want! > >> var query = session.CreateCriteria<TechSupportCallback>() > >> .SetCacheable(true) > >> .SetCacheRegion("CallbacksByUserAndGroups") > >> .SetProjection(Projections.ProjectionList() > >> .Add(Projections.Alias(Projections.Id(), ex.NameOf(x => > >> x.ID))) // > >> .Add(Projections.Alias(Projections.Property(ex.NameOf(x => > >> x.ContactID)), ex.NameOf(x => x.ContactID))) > >> // ... > >> ) > >> .SetResultTra...; > >> rValue = query.List<TechSupportCallback>(); > > >> -- > >> You received this message because you are subscribed to the Google Groups > >> "nhusers" group. > >> To post to this group, send email to [email protected]. > >> To unsubscribe from this group, send email to > >> [email protected]. > >> For more options, visit this group at > >>http://groups.google.com/group/nhusers?hl=en.- Hide quoted text - > > - Show quoted text - -- You received this message because you are subscribed to the Google Groups "nhusers" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/nhusers?hl=en.
