Questions tagged [syscache2]

SysCache2 is a 2nd level cache provider for NHibernate that can leverage SQL dependency-based expiration. It uses uses ASP.NET cache internally. Requires MS SQL Server 2000 or higher.

NHibernate is able to use external caching plugins to minimize the access to the database and improve the performance. SysCache2 is a drop-in cache provider implementation that uses ASP.NET cache. This provider also supports SQL dependency-based expiration, meaning that it is possible to configure certain cache regions to automatically expire when the relevant data in the database changes. SysCache2 requires Microsoft SQL Server 2000 or higher.

17 questions
25
votes
1 answer

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…
Bittercoder
  • 11,753
  • 10
  • 58
  • 76
15
votes
2 answers

How do I make NHibernate cache fetched child collections?

I've got a fairly simple criteria query that fetches child collections, like so: var order = Session.CreateCriteria() .Add(Restrictions.Eq("Id", id)) .SetFetchMode("Customer", FetchMode.Eager) .SetFetchMode("Products",…
Aaronaught
  • 120,909
  • 25
  • 266
  • 342
3
votes
1 answer

NHIbernate SysCache2 and SQLDependency problems

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:
3
votes
2 answers

nhibernate L2 caching: configure by code

how to configure second level cache in code (not thru xml) the current settings i have are: public NHCachingSetup(Configuration cfg) { // use first level cache cfg.Cache(x => { …
user2165424
3
votes
1 answer

Fluent NHibernate Syscache2 cache expiration

I've been working on a WCF service that uses fluent and syscache2. I've pretty much read every article on SO regarding my current dilemma; I've had no luck. I am trying to set the expiration time for my second-level cache. Whatever value I set…
Samir Banjanovic
  • 400
  • 1
  • 4
  • 16
2
votes
1 answer

NHibernate SysCache2 and the Query Cache - Cannot avoid a Select N+1?

I'm using the second level cache provider SysCache2 with Fluent NHibernate, using a standard fluent configuration (with query cache enabled as seems to be the general advice), and having table based dependencies defined in the usual…
Stumblor
  • 1,118
  • 8
  • 16
1
vote
1 answer

NHibernate + SysCache2 + SqlCacheDependency - Cache not invalidating in application

I have a basic MVC application that is using NHibernate for OR/M and data access, SysCache2 for the second-level cache in NHibernate, and SqlCacheDependency for the underlying cache invalidation logic. I believe I have everything setup correctly (I…
1
vote
1 answer

Are there any issues using Syscache in a multiserver environment as a nhibernate 2nd level cache?

i have just migrated from a single web server environment to a multiwebserver environment and i have been using nhibernate and the syscache 2nd level cache in the past. I know i need to move to a distributed nhibernate 2nd level caching solution…
leora
  • 188,729
  • 360
  • 878
  • 1,366
1
vote
1 answer

How to configure cache regions in fluent nhibernate and syscache2

I've been trying to implement cache regions with fluent nhibernate and I've done the following so far: 1) Setup caching in Fluently.Configure(): private static ISessionFactory CreateSessionFactory() { string csStringName =…
Marcus Oldin
  • 117
  • 1
  • 8
1
vote
1 answer

NHibernate SysCache2 - dependency breaks cache

Company class: class Company { public virtual int Id { get;set;} public virtual string Name { get;set;} public virtual int IntProp { get;set;} } Companies table: CREATE TABLE Companies ( Id INT PRIMARY KEY, Name NVARCHAR(50) NOT NULL, …
Mr. TA
  • 5,230
  • 1
  • 28
  • 35
1
vote
1 answer

NHibernate caching not working for anonymous type

I am trying to get the following query to work: Session.Linq() .SetCachable(true) .SetCacheRegion("foobar") .Select(x => new Baz(x.Foo, x.Bar)) .ToList(); This works when caching is turned off, but with caching enabled…
cbp
  • 25,252
  • 29
  • 125
  • 205
1
vote
1 answer

How to configure syscache's Region and Expiration using code (not in App.Config xml)

I'm trying to configure NHibernate's 2nd level cache. I want to configure by code and not use xml configuration I've followed most of the tutorial but I can't seem to translate this xml configuration in code:
ncfuncion
  • 227
  • 1
  • 3
  • 11
1
vote
1 answer

Cached Fetch for User Roles from NHibernate in an MVC App

Using classes like this... public class Login { public virtual Guid LoginId { get; set; } public virtual string Name { get; set; } public virtual string Email { get; set; } public virtual IList Groups { get; set; } } public…
1
vote
1 answer

Side effects of SessionFactory.Evict?

Every so often I am tasked with making alterations to one or more business entities in our database that may already be cached in our internal application. To get the application to reflect these changes without cycling the app pool, I figured I'd…
Nick Albrecht
  • 16,607
  • 10
  • 66
  • 101
1
vote
1 answer

Can I use NHibernate SysCache with Non-Web-Application?

I have a Windows Service which is using NHibernate (3) and SQL Server 2008. WPF-Clients are connecting over WCF to this Service for using DataAccess. My question is now: Can I use SysCache or SysCache2 in this Scenario - or are they only usable in…
BennoDual
  • 5,865
  • 15
  • 67
  • 153
1
2