From 39d9f84920081d3f110fca07ee30ca817f95d737 Mon Sep 17 00:00:00 2001 From: Vlad Mihalcea Date: Tue, 27 Nov 2018 13:38:46 +0200 Subject: [PATCH] HHH-13124 - The CachingRegionFactory resolution algorithm has changed --- .../main/asciidoc/userguide/chapters/caching/Caching.adoc | 3 ++- .../src/main/java/org/hibernate/cfg/AvailableSettings.java | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/documentation/src/main/asciidoc/userguide/chapters/caching/Caching.adoc b/documentation/src/main/asciidoc/userguide/chapters/caching/Caching.adoc index 05b698ac33..27e698832c 100644 --- a/documentation/src/main/asciidoc/userguide/chapters/caching/Caching.adoc +++ b/documentation/src/main/asciidoc/userguide/chapters/caching/Caching.adoc @@ -35,7 +35,8 @@ Detailed information is provided later in this chapter. Besides specific provider configuration, there are a number of configurations options on the Hibernate side of the integration that control various caching behaviors: `hibernate.cache.use_second_level_cache`:: - Enable or disable second level caching overall. The default is true, although the default region factory is `NoCachingRegionFactory`. + Enable or disable second level caching overall. By default, if the currently configured + https://docs.jboss.org/hibernate/orm/{majorMinorVersion}/javadocs/org/hibernate/cache/spi/RegionFactory.html[`RegionFactory`] is not the `NoCachingRegionFactory`, then the second-level cache is going to be enabled. Otherwise, the second-level cache is disabled. `hibernate.cache.use_query_cache`:: Enable or disable second level caching of query results. The default is false. `hibernate.cache.query_cache_factory`:: diff --git a/hibernate-core/src/main/java/org/hibernate/cfg/AvailableSettings.java b/hibernate-core/src/main/java/org/hibernate/cfg/AvailableSettings.java index 64bdd79fb3..7e95845d9f 100644 --- a/hibernate-core/src/main/java/org/hibernate/cfg/AvailableSettings.java +++ b/hibernate-core/src/main/java/org/hibernate/cfg/AvailableSettings.java @@ -1067,7 +1067,10 @@ public interface AvailableSettings extends org.hibernate.jpa.AvailableSettings { String CACHE_PROVIDER_CONFIG = "hibernate.cache.provider_configuration_file_resource_path"; /** - * Enable the second-level cache (enabled by default) + * Enable the second-level cache. + *

+ * By default, if the currently configured {@link org.hibernate.cache.spi.RegionFactory} is not the {@link org.hibernate.cache.internal.NoCachingRegionFactory}, + * then the second-level cache is going to be enabled. Otherwise, the second-level cache is disabled. */ String USE_SECOND_LEVEL_CACHE = "hibernate.cache.use_second_level_cache";