Hi Team NHibernate,

We have updated NHibernate and NHibernate.Caches.SysCache assemblies to '
*4.0.0.4000*' in our project.
However, now while using second level caching using following code, we are 
getting 'ArgumentNullException':
            ISQLQuery query = null;
            ISession session = ProviderHelper.GetSession();
            query = session.CreateSQLQuery("select count(*) as number from 
tCSEmailList where email=:Email");
            query.SetParameter("Email", email);
            query.AddScalar("number", NHibernateUtil.Int32);
                query.SetCacheable(true);
                query.SetCacheRegion("Type");
                var count = query.UniqueResult<int>();    //Getting the 
error here

*Error: ArgumentNullException*
Value cannot be null.
Parameter name: includeInTuple
Stack Trace:
   at NHibernate.Transform.CacheableResultTransformer..ctor(Boolean[] 
includeInTuple, Boolean[] includeInTransform)
   at NHibernate.Transform.CacheableResultTransformer.Create(
IResultTransformer transformer, String[] aliases, Boolean[] includeInTuple)
   at NHibernate.Loader.Loader.ListUsingQueryCache(ISessionImplementor 
session, QueryParameters queryParameters, ISet`1 querySpaces, IType[] 
resultTypes)
   at NHibernate.Impl.SessionImpl.ListCustomQuery(ICustomQuery customQuery, 
QueryParameters queryParameters, IList results)
   at NHibernate.Impl.AbstractSessionImpl.List(NativeSQLQuerySpecification 
spec, QueryParameters queryParameters, IList results)
   at NHibernate.Impl.AbstractSessionImpl.List(NativeSQLQuerySpecification 
spec, QueryParameters queryParameters)
   at NHibernate.Impl.SqlQueryImpl.List()
   at NHibernate.Impl.AbstractQueryImpl.UniqueResult[T]()
   at 
Guru.Data.NHibernate.DataProviders.MessagingData.CSDSIncomingEmailProvider.IsEmailExistsInEmailList(String
 
email) in c:\******.cs:line 278

However, on removing following second level caching code, the query runs 
fine:
                query.SetCacheable(true);
                query.SetCacheRegion("Type");

Please help us out. This is showstopper for us.
Thanks in advance.

Shubham

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/nhusers.
For more options, visit https://groups.google.com/d/optout.

Reply via email to