Is there any reason I shouldn't cache in nHibernate? -


I have just discovered the cache's happiness. ReadWrite () is fluent in nHibernate, and is extensively analyzing the results with nhprof

It seems that is quite useful, but it is slightly Seems misleading. Is there any special reason that I do not do want to cache the very frequently used object from a query? I mean, I have to guess that I should not go to decorate every single mappings with just one cache property ... or me?

As always, it depends :) :)

If there is some ability to update by background processes, Do not use, or are converted directly into the database, caching will cause problems.

Institutions that are accessed indefinitely can not be a good candidate for second level caching, as they will still be replaced.

In addition, you can see some strangeness if you have mapped archives as inversion - the changes will not be raised correctly by the second level cache and you have to manually remove the collection .

As sJhonny below shows, if you have a web farm scenario (or any where your app is running on many servers), then you have a ASP.N. Instead of creating a cash cache, use a distributed cache (like a memacatch).

Comments