Ok, I corrected my issue. It was of course something in my code and not in NHibernate or Rhino.
The problem was in the way I was registering the repositories and how I used the interceptor with them. The interceptor was not called when it should have been... Thank you all for your answers. I'm sorry I took so much of your time for nothing... On Sep 8, 1:04 am, "Ayende Rahien" <[EMAIL PROTECTED]> wrote: > There was a bug when nested calls to With.Caching, that you have to be aware > of, it is likely to be that issue. > > On Mon, Sep 8, 2008 at 2:00 AM, Gildas <[EMAIL PROTECTED]> wrote: > > > Well, I think I find out why the cache was not working anymore in my > > case. What I don't understand is that it was working before... > > > As you may have guessed already, I followed Ayende's article (http:// > > >www.ayende.com/Blog/archive/2007/03/11/AOP-With-Windsor-Adding-Cachin... > > ) > > to enforce the use of With.QueryCache on my repositories. Yes Ayende, > > I'm a big fan of your blog ;-) > > > I don't know why, but the With.Caching.Enabled property is set back to > > false when out of the interceptor code... > > So, I rewrited my call to Repository<MyEntity>.FindOne( criteria ) and > > surrounded it with the With.QueryCache. That worked. The second level > > cache has been used this time. > > > I'm not saying that Ayende's article is wrong. I must have done > > something but I don't know what yet. I'll try to find out what it is > > and if I can't, I will surround all my Repositories calls with > > With.QueryCache. > > > Thanks for your patience. > > > On Sep 8, 12:28 am, Gildas <[EMAIL PROTECTED]> wrote: > > > Hi again :) > > > > I tried to debug step by step again. Here's what I found : > > > > I call Repository<MyEntityType>.FindOne( criteria ); > > > => criteria is using NHQG > > > > I have an interceptor on all my repositories which enforces the use of > > > With.QueryCache( regionName ) from Rhino.Commons. > > > => The interceptor works, I steped through the concerned lines > > > > However, when I finally get to > > > CriteriaQueryTranslator.GetQueryParameters(), the resulting > > > queryParameter is not cacheable and the region is not set. > > > Of course, the List method which check this parameter does not even > > > try to get the cached result. > > > > Hope this can help you guys. Thanks for your time. > > > > On Sep 8, 12:14 am, "James Kovacs" <[EMAIL PROTECTED]> wrote: > > > > > I am looking at it right now. Initial investigations... The problem > > seems to > > > > stem from lack of transaction handling in the test case. If rather than > > > > flushing the session, you commit a transaction, the SysCache returns > > data > > > > appropriately. I'll post more as I find out more. (Just posting to save > > > > Ayende some time.) > > > > > James > > > > -- > > > > James Kovacs, B.Sc., M.Sc., MCSD, MCT > > > > Microsoft MVP - C# Architecturehttp://www.jameskovacs.com > > > > [EMAIL PROTECTED](mobile) > > > > > On Sun, Sep 7, 2008 at 4:07 PM, Ayende Rahien <[EMAIL PROTECTED]> > > wrote: > > > > > Guys, > > > > > I am going to look at the issue now, will post my results soon > > > > > > On Sun, Sep 7, 2008 at 10:44 PM, Gildas <[EMAIL PROTECTED]> > > wrote: > > > > > >> Fabio, I know that I'm still noob in NHibernate and that I may ask > > > > >> stupid questions. I'm sorry if you are bored with this, but well, > > > > >> please understand that I'm just trying to resolve a problem I did > > not > > > > >> have before upgrading to last NHibernate trunk. > > > > > >> Going through Rhino code, I can see that my session is created at > > each > > > > >> request, so that's not the problem. > > > > >> Anyway, I still don't have any second level cache. Items are updated > > > > >> but never retrieved from it. > > > > > >> Can someone check the test case from craig, which is failing and > > don't > > > > >> use any fancy session management ? > > > > > >> Thanks > > > > > >> On Sep 7, 8:35 pm, "Fabio Maulo" <[EMAIL PROTECTED]> wrote: > > > > >> > 2008/9/7 Gildas <[EMAIL PROTECTED]> > > > > > >> > > So I'm going to ask if this is the right way to handle sessions > > ? From > > > > >> > > what I remember of NHibernate, NH Sessions must not be stored in > > > > >> > > HttpContext.Session. I may not understand the reasons why this > > done > > > > >> > > like this in UnitOfWorkApplication, maybe for long transactions > > > > >> > > management ? > > > > > >> > Rhino UoW use httpSession only for long conversation... > > > > >> > The NhSession CAN be stored in the httpSession simply because is > > the > > > > >> "most > > > > >> > simple" way to manage long-conversations. > > > > >> > -- > > > > >> > 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 -~----------~----~----~----~------~----~------~--~---
