Not 100% sure but try NHibernateUtil.Int16 instead. Perhaps it cannot cast 
short to int.


Hi Andrew,
>
> Thank you very much for sharing the patch.
> However, after using this assembly, I started getting error:
> Specified cast is not valid.
>
> Stack Trace:
>    at NHibernate.Impl.AbstractQueryImpl.UniqueResult[T]()
>    at ****.NHibernate.DataProviders.********(String email)
>    in ****\DataProviders\****.cs:line 278
>
> The code is something like:
>             ISQLQuery query = null;
>             ISession session = ProviderHelper.GetSession();
>             query = session.CreateSQLQuery("select count(*) as number from 
> tmailList where email=:Email");
>             query.SetParameter("Email", email);
>             query.AddScalar("number", NHibernateUtil.Int32);
>             if (query != null)
>             {
>                 query.SetCacheable(true);
>                 query.SetCacheRegion("Type");
>                 var count = query.UniqueResult<int>();            *//Getting 
> Error here*
>                 if (count > 0)
>                     result = true;
>             }
>
> Any idea what could be wrong here.
> Thanks in advance.
> Shubham
>
> On Friday, 24 June 2016 02:45:03 UTC+5:30, Andrew K wrote:
>>
>> I've had to patch 4.0.4 by myself. Feel free to download hotfixed dll 
>> from the attachment. The only change is NH-3666, as from this commit: 
>> https://github.com/nhibernate/nhibernate-core/pull/416
>>
>> Ricardo,
>>>
>>> Can I have update on this issue. Please help.
>>>
>>> Thanks
>>>
>>> On Friday, 17 June 2016 03:07:49 UTC+5:30, Ricardo Peres wrote:
>>>>
>>>> Can you show your cache configuration?
>>>>
>>>> RP
>>>>
>>>

-- 
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