diff --git a/doc/reference/modules/nhibernate_caches.xml b/doc/reference/modules/nhibernate_caches.xml index e45dfad32d1..997b5ff1a0b 100644 --- a/doc/reference/modules/nhibernate_caches.xml +++ b/doc/reference/modules/nhibernate_caches.xml @@ -2,7 +2,6 @@ NHibernate.Caches - What is NHibernate.Caches? @@ -243,6 +242,43 @@ +
+ Using a custom configuration provider + + + Most caches have their own configuration section. By default, the cache attempts to read its configuration section + through the .Net ConfigurationManager. Some environments do not support it, especially when + running under .Net Core. The .Net Core compatible caches provide a way to set a custom configuration provider, through + their NHibernate.Caches. cache specific namespace .ConfigurationProvider class. + + + + To disable the configuration provider, in case you configure the cache entirely programmatically, + set its ConfigurationProvider.Current property to null. + + + + + + To provide directly the System.Configuration.Configuration instance to use, call + the cache ConfigurationProvider.SetConfiguration method. + + + + + + You may also derive a custom provider from the ConfigurationProvider of the cache, + implements its abstract method GetConfiguration, and assign an instance of your + custom provider to the cache ConfigurationProvider.Current property. + + + + Changes of the ConfigurationProvider.Current property value are to be done very + early in the application lifecycle, before building any session factory using the cache provider or + before any other call on the cache API. Otherwise they will not be taken into account. + +
+
Prevalence Cache Configuration @@ -251,7 +287,7 @@ full path. If the directory doesn't exist, it will be created. - The prevalenceBase setting can only be set programmatically through on the NHibernate + The prevalenceBase setting can only be set programmatically through the NHibernate configuration object, by example with Configuration.SetProperty.
@@ -260,6 +296,11 @@ SysCache Configuration SysCache relies on System.Web.Caching.Cache for the underlying implementation. + This is a .Net Framework only library, since System.Web.Caching is available neither + in the .Net Standard nor in .Net Core. + + + The following NHibernate configuration settings are available: @@ -316,12 +357,18 @@ SysCache2 Configuration - SysCache2 can use SqlCacheDependencies to invalidate cache regions when data in an underlying SQL Server + SysCache2 uses System.Web.Caching like SysCache, but can use SqlCacheDependencies + to invalidate cache regions when data in an underlying SQL Server table or query changes. Query dependencies are only available for SQL Server 2005 or higher. To use the cache provider, the application must be setup and configured to support SQL notifications as described in the MSDN documentation. + + This is a .Net Framework only library, since System.Web.Caching is available neither + in the .Net Standard nor in .Net Core. + + The following NHibernate configuration settings are available: @@ -625,6 +672,7 @@ Its configuration relies on the EnyimMemcached library own configuration, through its enyim.com/memcached configuration section. See project site. + This is a .Net Framework only library. @@ -633,6 +681,9 @@ RtMemoryCache relies on System.Runtime.Caching.MemoryCache for the underlying implementation. + + + The following NHibernate configuration settings are available: @@ -674,6 +725,12 @@ ]]> + + + The loading of this section can be customized with the + NHibernate.Caches.RtMemoryCache.ConfigurationProvider class. See + . +
@@ -681,7 +738,11 @@ NHibernate.Caches.StackExchangeRedis relies on StackExchange.Redis for the underlying implementation. - The following NHibernate configuration settings are available (also defined in NHibernate.Caches.StackExchangeRedis.RedisEnvironment): + + + + The following NHibernate configuration settings are available (also defined in + NHibernate.Caches.StackExchangeRedis.RedisEnvironment): @@ -975,10 +1036,16 @@ + strategy="NHibernate.Caches.StackExchangeRedis.FastRegionStrategy, NHibernate.Caches" /> ]]> + + + The loading of this section can be customized with the + NHibernate.Caches.StackExchangeRedis.ConfigurationProvider class. See + . +
@@ -986,6 +1053,9 @@ CoreMemoryCache relies on Microsoft.Extensions.Caching.Memory.MemoryCache for the underlying implementation. + + + The following NHibernate configuration settings are available: @@ -1029,6 +1099,12 @@ ]]> + + + The loading of this section can be customized with the + NHibernate.Caches.CoreMemoryCache.ConfigurationProvider class. See + . +
@@ -1038,6 +1114,9 @@ implementations. The implementation has to be provided through an IDistributedCacheFactory, either supplied through configuration or programmatically by affecting CoreDistributedCacheProvider.CacheFactory before building a session factory. + + + The following NHibernate configuration settings are available: @@ -1092,15 +1171,23 @@ 00:10:00 1048576 - NHibernate.Caches.Util.JsonSerializer.JsonCacheSerializer, NHibernate.Caches.Util.JsonSerializer + NHibernate.Caches.Util.JsonSerializer.JsonCacheSerializer, NHibernate.Caches.Util.JsonSerializer - + ]]> + + The loading of this section can be customized with the + NHibernate.Caches.CoreDistributedCache.ConfigurationProvider class. See + . + + CoreDistributedCache does not support NHibernate.Cache.ICache.Clear. Clearing the NHibernate cache has no effects with CoreDistributedCache.