views:

413

answers:

2

Hi,

We've a relatively mature website using Castle's ActiveRecord for it's persistance pattern (along with nHiberante). We've been using single node caching and so could rely on the built in ASP.Net cache and simply use ActiveRecord's Cache tag on our entities ([ActiveRecord(Cache = CacheEnum.ReadWrite)]). This works fine, and NHProf has confirmed that we're hitting the 2nd level cache.

We're now pregressing to x-Nodes and need a cache that can sync across multiple nodes. We're trialling nCache, and I've got it setup (perfmon counters shows test cache additions are successful). However after modifying the web.config and adding references to my app (for the config section) all seems well.

However the perf counters aren't moving as I move throguh the site. All the docs mention individual

<ncache><class></class></ncache>

settings for each and every class to be cached. Obviously I'd liek the ActiveRecord markup to be used for this.

And finally to the question - anyone know if NCache uses the ActiveRecord cache tags or do I have to use the web.config to specify cacheing strategy ? I really want to use the ActiveRecord tags....

+1  A: 

Ok I've found a number of answers and gotchas, and most importantly now have it working, so here's some pointers that people may find useful:

  • The ActiveRecord Cache works absolutely fine with NCache, no changes needed.
  • NCache is currently shipped against nHibernate 1.2 and built against .Net 2.0

We have a custom version (from Castle trunk) of nHibernate. We are also using .Net3.5. As a result we had to:

  • Add the source of the NCache nHibernate adapter
  • Port the code to 3.5 (with some minor amendments)
  • Update out config file

That's it. Perfmon has NCache tickers flipping as we visit the site. Awesome.

If required I can post code, just let me know.

All thanks to http://www.alachisoft.com/forum/index.php?showtopic=18488

ip
A: 

thanks for posting the information its really helpful. Please could you post the code for this.

Thank You, VD

vd