syscache2

NHibernate caching not working for anonymous type

I am trying to get the following query to work: Session.Linq<FooBar>() .SetCachable(true) .SetCacheRegion("foobar") .Select(x => new Baz(x.Foo, x.Bar)) .ToList(); This works when caching is turned off, but with caching enabled I receive the following exception: System.InvalidCastException: Unable to cast object of typ...

NHIbernate SysCache2 and SQLDependency problems

Hi, I've set enable_broker on my SQL Server 2008 to use SQLDepndency I've configured my .Net app to use Syscache2 with a cache region as follows: <syscache2> <cacheRegion name="BlogEntriesCacheRegion" priority="High"> <dependencies> <commands> <add name="BlogEntries" command="Sel...

How to clear the entire second level cache in NHibernate

I wish to clear the entire second level cache in NHibernate via code. Is there a way to do this which is independent of the cache provider being used? (we have customers using both memcache and syscache within the same application). We wish to clear the entire cache because changes external the database would have occurred (which we ha...

How to configure cache regions in fluent nhibernate and syscache2

Hi, I've been trying to implement cache regions with fluent nhibernate and I've done the following so far: Setup caching in Fluently.Configure():   private static ISessionFactory CreateSessionFactory() { string csStringName = Environment.MachineName; var nhibConfigProps = new Dictionary<string, string>(); ...