NCache 4.6 - Online Documentation

How to Configure Cacheable Objects

Enabling the use of second level cache does not cache each class object by default. Instead classes needed to be cached are to be marked cacheable in class mapping (.hbm.xml) file. To mark a class cacheable, add the following tag in class's configuration:
    <cache usage="read-write" region ="AbsoluteExpirationRegion"/>
In the tag above, properties usage and region can be changed.
Specifies name of second level cache region to be used for this class's objects. If no region is specified, fully qualified class name will be used as region name with default region configurations.
Specifies caching concurrency strategy to be used for this class. NHibernate allows following three concurrency strategies to be used for caching:
  • Read-Write
  • Nonstrict-Read-Write
  • Read-Only
See Also