Sorry to not have provided a test case yet. I did not try the test
case from Craig neither. However, I did try to understand what is
going on in the NHibernate code. I'm not an expert at all of
NHibernate but well, I tried to find the usages of the ICache and
ICacheConcurrencyStrategy interfaces and finally got to the
DefaultLoadEventListener class and its DoLoad method. The entity is
always loaded from the Session cache, it nevers reach the code which
should try to find the entity inside the second level cache :
LoadFromSecondLevelCache.

I'm using NHibernate and SysCache compiled from the trunk, targeting
the framework 3.5. My Nhibernate options are set so that query cache
is used and SysCache is configured with regions.

The code I use to load entities has not changed from weeks, but I do
have updated the nhibernate library so I'm quite sure something has
changed.
I use Ayende's Rhino library and repositories for ActiveRecord. The
code making the request uses the With.QueryCache method.

In the SysCache logs, I can see that my entities are updated each time
I try to get them. But the Get method is never called.
In Nhibernate logs, see "adding entity to second-level cache" messages
each time an entity is loaded.

I'll check the patch from Craig now and try to find out more.

Gildas

On Sep 7, 4:47 pm, "Gustavo Ringel" <[EMAIL PROTECTED]> wrote:
> this is my caching configuration in boo for NH:
> cache.provider_class = "NHibernate.Caches.SysCache.SysCacheProvider,
> NHibernate.Caches.SysCache"
> cache.use_query_cache = "true"
>
> and i add to the app.config sections
>
> <section name="syscache" type="
> NHibernate.Caches.SysCache.SysCacheSectionHandler,NHibernate.Caches.SysCache
> " />
>
> followed by
>
> <syscache>
>
> <cache region="readonly" expiration="120" priority="3" />
>
> </syscache>
>
> all of this to set the region readonly which is the only one i set meantime.
>
> Gustavo.
> On Sun, Sep 7, 2008 at 4:24 PM, Gustavo Ringel <[EMAIL PROTECTED]>wrote:
>
> >  he...i'm now embarrased, i really use SysCache (caching it works so
> > nicely that i forget what strategy i use)
>
> > I have no problems in my scenario: lot's of repeatable gets, a few cached
> > queries on mappings
>
> > Enviroment:
> > Visual studio 2008 SP1 + .NET 2.0 sp1 (using autoproperties + lambdas)
> > SysCache compiled using the trunk
> > NHibernate compiled using the trunk.
>
> > Caching is working...i don't have the time now to check your patch or build
> > a test of my own...but it works...
>
> > If you want i can send you the dll's i compiled in a mail...
>
> > Gustavo.
> >   On Sun, Sep 7, 2008 at 3:57 PM, Craig Neuwirt <[EMAIL PROTECTED]>wrote:
>
> >> No problem :-)  I'll have to try SysCache2
>
> >> thanks,
> >>   craig
>
> >> On Sun, Sep 7, 2008 at 8:51 AM, Gustavo Ringel <[EMAIL PROTECTED]>wrote:
>
> >>> ah, ok :).
>
> >>> Excuse me then!
>
> >>> Gustavo.
>
> >>> On Sun, Sep 7, 2008 at 3:30 PM, Craig Neuwirt <[EMAIL PROTECTED]>wrote:
>
> >>>> The ticket is for SysCache.  The component is SysCache/SysCache2
>
> >>>> On Sun, Sep 7, 2008 at 8:06 AM, Gustavo Ringel <
> >>>> [EMAIL PROTECTED]> wrote:
>
> >>>>>  Hi you were talking always about SysCache, and i'm not working on it
> >>>>> so i could not say if it is ok.
>
> >>>>> Now in your ticket i saw that you mean SysCache2. I'm using SysCached 2
> >>>>> without a problem in my app...from the contrib trunk, i compiled it 
> >>>>> with the
> >>>>> trunk and it works like a charm...
>
> >>>>> i remember i had a problem, but it was an stupid one, i was expecting a
> >>>>> criteria to be cached without enabling the query cache!
>
> >>>>> I have a lot of read-only immutable code tables that i'm reading with
> >>>>> Get and i only get a query for each record...
>
> >>>>> Gustavo.
>
> >>>>> On Sun, Sep 7, 2008 at 2:54 PM, Craig Neuwirt <[EMAIL PROTECTED]>wrote:
>
> >>>>>> Sorry for the delay.  Dealing with some sick children
>
> >>>>>> Here is the jira ticket for this item
>
> >>>>>>http://jira.nhibernate.org/browse/NHCH-16
>
> >>>>>> Thanks,
> >>>>>>   craig
>
> >>>>>> On Sat, Sep 6, 2008 at 3:50 PM, Fabio Maulo <[EMAIL PROTECTED]>wrote:
>
> >>>>>>>  2008/9/6 Craig Neuwirt <[EMAIL PROTECTED]>
>
> >>>>>>>> Sure Ayende, will do.  I'll probably set it up to run in the
> >>>>>>>> NHibernate.Caches.SysCache.Tests project
>
> >>>>>>> And please create a JIRA ticket to attach the test.
> >>>>>>>http://jira.nhibernate.org/browse/NHCH
>
> >>>>>>> Thanks.
> >>>>>>> --
> >>>>>>> Fabio Maulo
--~--~---------~--~----~------------~-------~--~----~
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