where can i find SharedCache with fluent nhibernate getting started guid
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
There is very little documentation I’ve found for getting SharedCache working with NHibernate, let alone doing it fluently. However, it’s not a hard process:
You need to tell NHibernate you’re using SharedCache as a cache provider. Another Stack Overflow answer gives a sample implementation for Fluent NHibernate. The key bit is the
Cachefunction, except here you will want to useNHibernate.Caches.SharedCache.SharedCacheProviderinstead ofNHibernate.Cache.HashtableCacheProvider.As an aside, to configure it non fluently you use something like this in your configuration:
Or, if you’re configuring via Spring.NET with the rest of your NHibernate configuration entries:
You will then need to add web.config / app.config entries for the cache as you would when using SharedCache without NHibernate, for example:
You can find plenty more information about configuring a SharedCache client on their website, although be sure to configure each server too.
Hope this helps – I haven’t been able to fully test this, so I may’ve made a mistake somewhere.