Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NHibernate SysCacheProvider default expiration and cache regions

Tags:

nhibernate

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?

like image 942
JimGoods Avatar asked Jun 02 '10 16:06

JimGoods


People also ask

How does NHibernate cache work?

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.

How do I clear NHibernate cache?

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().

What is fetch in NHibernate?

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.


1 Answers

In the config file:

<property name="cache.default_expiration">seconds</property>
like image 81
Diego Mijelshon Avatar answered Oct 05 '22 23:10

Diego Mijelshon