Is there a way that the default NHibernate.Caches.SysCache.SysCacheProvider expiry time of 5 minutes can be configured without the use of cache regions? Is there a hibernate property that can be set from config?
An NHibernate session has an internal (first-level) cache where it keeps its entities. There is no sharing between these caches - a first-level cache belongs to a given session and is destroyed with it. NHibernate provides a second-level cache system; it works at the session factory level.
NHibernate will evict associated entities automatically if the association is mapped with cascade="all" or cascade="all-delete-orphan". The ISession also provides a Contains() method to determine if an instance belongs to the session cache. To completely evict all objects from the session cache, call ISession. Clear().
A fetching strategy is the strategy NHibernate will use for retrieving associated objects if the application needs to navigate the association. Fetch strategies may be declared in the O/R mapping metadata, or overridden by a particular HQL or Criteria query.
In the config file:
<property name="cache.default_expiration">seconds</property>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With