Missing batch-size on the Risk mapping?

/Oskar


2012/9/12 Christian I. <[email protected]>

> Hello,
>
> I join a screenshot. I have a Customer table and a Risk (with 4 rows)
> table, each customer is associate to a risk.
>
> 1. First transaction, I get the list of customer
> 2. I select one, to see detail, I get the list of risk to display in a
> dropdown
> 3. Thirs transaction, back to the list of customer
> 4. I select an another one, now I see Nhibernate use the cache. The
> question is : is it normal I have 4 queries to the risk table. On the
> fourth NHProfiler warn me (N+1)
>
> I did something wrong ?
>
> Thanks,
>
> Implementation I use :
>
> 1. In the web.config, in the configSections : <section name="syscache"
> type="NHibernate.Caches.SysCache.SysCacheSectionHandler,
> NHibernate.Caches.SysCache" />
>
> 2.   <syscache>
>     <cache region="SomeCustomNameRegion" expiration="86400" priority="5" />
>   </syscache>
>
> 3. The query :
>     public IList<Risk> GetListRisk()
>         {
>             return Session.QueryOver<Risk>()
>                 .Cacheable()
>                 .CacheMode(CacheMode.Normal)
>                 .CacheRegion("SomeCustomNameRegion")
>                 .List<Risk>();
>         }
>
>
> <https://lh5.googleusercontent.com/-Ukx4g_2VUfw/UFC4lBPQ16I/AAAAAAAAHGQ/ViHRoh6G_Qw/s1600/12-09-2012+18-20-43.png>
>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "nhusers" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/nhusers/-/4hi3SIXFwcIJ.
> 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.
>

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

Reply via email to