We have several areas of caching created in our implementation of nHibernate. To avoid problems with load-balanced servers, I want to effectively disable caching on pages that edit cached data. I can write a method that completely clears all query caches, class caches, and my entity.
But I really want to clear the cache by region. sessionFactory.EvictQueries () will accept the scope parameter, but Evict () and EvictCollection () do not. I really don't want to throw away the entire cache here, and I don't want to maintain some kind of clumsy dictionary associating types with their cache areas. NHibernate has a way to query an entity or collection, what are its caching settings?
thank
source
share