The links below give hints as to the secret sauce for configuring cache http://ayende.com/Blog/archive/2006/08/21/TheSecretLifeOfNHibernatesCaches.aspx http://nhforge.org/blogs/nhibernate/archive/2009/02/09/quickly-setting-up-and-using-nhibernate-s-second-level-cache.aspx
John Davidson On Fri, Apr 9, 2010 at 12:26 PM, Kent Boogaart <[email protected]>wrote: > Hi, > > I have a SQL query: > > var filterValues = session > .CreateSQLQuery(sql) > ////.SetCacheable(true) > .SetParameter("parent", qualifiedName) > .SetResultTransformer(Transformers.AliasToBean(typeof(FilterValue))) > .List<FilterValue>(); > > The actual SQL does not appear to matter. If I uncomment the > SetCacheable call I get an exception: > > System.IndexOutOfRangeException: Index was outside the bounds of the > array. > at NHibernate.Type.TypeFactory.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, ISet`1 querySpaces, IType[] > resultTypes) > at NHibernate.Loader.Loader.List(ISessionImplementor session, > QueryParameters queryParameters, ISet`1 querySpaces, IType[] > resultTypes) > at NHibernate.Loader.Custom.CustomLoader.List(ISessionImplementor > session, QueryParameters queryParameters) > at NHibernate.Impl.SessionImpl.ListCustomQuery(ICustomQuery > customQuery, QueryParameters queryParameters, IList results) > at NHibernate.Impl.SessionImpl.List(NativeSQLQuerySpecification > spec, QueryParameters queryParameters, IList results) > at NHibernate.Impl.SessionImpl.List[T](NativeSQLQuerySpecification > spec, QueryParameters queryParameters) > at NHibernate.Impl.SqlQueryImpl.List[T]() > > I've seen this already (http://www.mailinglistarchive.com/html/ > [email protected]/2010-01/msg00404.html) but I'm not using > named queries. > > Is what I'm doing supported? Is there some way I can specify whatever > extra info is required to support caching? > > Thanks, > Kent > > -- > 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]<nhusers%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/nhusers?hl=en. > > -- 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.
