tag:blogger.com,1999:blog-3924739636407907202.post7344592081606465495..comments2023-10-07T05:59:41.036-03:00Comments on HunabKu: Tuning NHibernate: Tolerant QueryCacheFabio Maulohttp://www.blogger.com/profile/13558454874302740335noreply@blogger.comBlogger10125tag:blogger.com,1999:blog-3924739636407907202.post-89126201492822979162009-04-06T14:27:00.000-03:002009-04-06T14:27:00.000-03:00BTW Diego... which is the usecase ?You can use the...BTW Diego... which is the usecase ?<BR/>You can use the uNhAddIns list if you want talk about the specific case.Fabio Maulohttps://www.blogger.com/profile/13558454874302740335noreply@blogger.comtag:blogger.com,1999:blog-3924739636407907202.post-45522414410307006862009-04-06T14:21:00.000-03:002009-04-06T14:21:00.000-03:00@Diegommmm that is another thing....I would avoid ...@Diego<BR/>mmmm that is another thing....<BR/>I would avoid "manual" work.<BR/>Perhaps you are talking about "SensibleQueryCache" ;) (not implemented yet)Fabio Maulohttps://www.blogger.com/profile/13558454874302740335noreply@blogger.comtag:blogger.com,1999:blog-3924739636407907202.post-77825451600116075912009-04-06T14:02:00.000-03:002009-04-06T14:02:00.000-03:00Of course I'm not suggesting an API, I'm just talk...Of course I'm not suggesting an API, I'm just talking about the requirement!Diego Jancichttps://www.blogger.com/profile/05757820946421364916noreply@blogger.comtag:blogger.com,1999:blog-3924739636407907202.post-37714649707054241582009-04-06T13:59:00.000-03:002009-04-06T13:59:00.000-03:00Nice test!. I guess it would be nice to overwrite ...Nice test!. I guess it would be nice to overwrite the internal key used. Since sometimes not all the table needs such tolerance. But it will require a change in the NH APIs.<BR/><BR/>Imagine this:<BR/>var q = new DetachedQuery("from MusicCD where Author = :Author")<BR/> .SetCacheKey("getCdsByAuthor" + cd.Author.Id);<BR/><BR/><BR/>// And in another place, when you create a new MusicCD:<BR/>Diego Jancichttps://www.blogger.com/profile/05757820946421364916noreply@blogger.comtag:blogger.com,1999:blog-3924739636407907202.post-49853189958568533352009-04-06T10:41:00.000-03:002009-04-06T10:41:00.000-03:00The example using SysCache, as cache provider, is ...The example using SysCache, as cache provider, is available<BR/>http://code.google.com/p/unhaddins/source/browse/trunk/uNhAddIns/uNhAddIns.Test/Cache/FullIntegrationFixture.csFabio Maulohttps://www.blogger.com/profile/13558454874302740335noreply@blogger.comtag:blogger.com,1999:blog-3924739636407907202.post-26382811771570070892009-04-05T10:36:00.000-03:002009-04-05T10:36:00.000-03:00-The TolerantQueryCache avoid the Cache invalidati...-The TolerantQueryCache avoid the Cache invalidation for creates/updates/deletes.<BR/>-If you use TolerantQueryCache with SysCache after 10 minute ONE user may have a slow response. Without TolerantQueryCache EACH user may have a slow response.<BR/>-The decision about which cache you should use is not influenced by the TolerantQueryCache usage.Fabio Maulohttps://www.blogger.com/profile/13558454874302740335noreply@blogger.comtag:blogger.com,1999:blog-3924739636407907202.post-11434444199601330072009-04-05T06:29:00.000-03:002009-04-05T06:29:00.000-03:00...And, since the SysCache isn't cluster-scoped, t......And, since the SysCache isn't cluster-scoped, this would multiply for each server in the farm?Tobin Harrishttps://www.blogger.com/profile/02203581553681366247noreply@blogger.comtag:blogger.com,1999:blog-3924739636407907202.post-91330859486504661732009-04-05T06:28:00.000-03:002009-04-05T06:28:00.000-03:00Cheers.Wouldn't that mean that every 10 minutes on...Cheers.<BR/><BR/>Wouldn't that mean that every 10 minutes one of your users is going to have a *really* slow page load as the cache is rebuilt during their HTTP request?Tobin Harrishttps://www.blogger.com/profile/02203581553681366247noreply@blogger.comtag:blogger.com,1999:blog-3924739636407907202.post-3772443062613284452009-04-04T20:56:00.000-03:002009-04-04T20:56:00.000-03:00No Tobin, the responsibility to evict the cache is...No Tobin, the responsibility to evict the cache is delegated to the cache provider.<BR/>In practice if you are using SysCache and you set the cache expiration to 10 minutes for the region "SearchStatistics", the region expire after 10 minutes.<BR/><BR/>Thanks for ask I will change the example using SysCache.Fabio Maulohttps://www.blogger.com/profile/13558454874302740335noreply@blogger.comtag:blogger.com,1999:blog-3924739636407907202.post-66364143869831692862009-04-04T20:30:00.000-03:002009-04-04T20:30:00.000-03:00This looks pretty sweet. So, if I understood corre...This looks pretty sweet. <BR/><BR/>So, if I understood correctly, the query cache is not invalidated by creates/updates/deletes to relevant entities, and the query cache is allowed to serve stale data? The benefit being that using this for expensive queries are cached for longer putting less strain on the app.<BR/><BR/>I suppose for this scenario you'd run an hourly/nightly job to manually Tobin Harrishttps://www.blogger.com/profile/02203581553681366247noreply@blogger.com