diff --git a/hibernate-core/src/main/java/org/hibernate/cache/spi/SecondLevelCacheLogger.java b/hibernate-core/src/main/java/org/hibernate/cache/spi/SecondLevelCacheLogger.java index f81c86476f5f..6976148bcba7 100644 --- a/hibernate-core/src/main/java/org/hibernate/cache/spi/SecondLevelCacheLogger.java +++ b/hibernate-core/src/main/java/org/hibernate/cache/spi/SecondLevelCacheLogger.java @@ -5,7 +5,6 @@ package org.hibernate.cache.spi; import org.hibernate.internal.log.SubSystemLogging; -import org.hibernate.metamodel.model.domain.NavigableRole; import org.jboss.logging.BasicLogger; import org.jboss.logging.Logger; @@ -37,15 +36,15 @@ public interface SecondLevelCacheLogger extends BasicLogger { @LogMessage(level = WARN) @Message( - value = "Attempt to restart an already started RegionFactory. Use sessionFactory.close() between " + - "repeated calls to buildSessionFactory. Using previously created RegionFactory.", + value = "Attempt to start an already-started RegionFactory, probably because a SessionFactory was not closed." + + " Using previously created RegionFactory.", id = NAMESPACE + 1 ) void attemptToStartAlreadyStartedCacheProvider(); @LogMessage(level = WARN) @Message( - value = "Attempt to restop an already stopped JCacheRegionFactory.", + value = "Attempt to stop an already-stopped JCacheRegionFactory.", id = NAMESPACE + 2 ) void attemptToStopAlreadyStoppedCacheProvider(); @@ -55,33 +54,27 @@ public interface SecondLevelCacheLogger extends BasicLogger { value = "Read-only caching was requested for mutable entity [%s]", id = NAMESPACE + 3 ) - void readOnlyCachingMutableEntity(NavigableRole navigableRole); + void readOnlyCachingMutableEntity(String entity); @LogMessage( level = WARN ) @Message( value = "Read-only caching was requested for mutable natural-id for entity [%s]", id = NAMESPACE + 4 ) - void readOnlyCachingMutableNaturalId(NavigableRole navigableRole); + void readOnlyCachingMutableNaturalId(String entity); - /** - * Log a message (WARN) about expiry of soft-locked region. - */ @LogMessage(level = INFO) @Message( - value = "Cache[%s] Key[%s]\n" + - "A soft-locked cache entry was expired by the underlying cache. If this happens regularly you " + - "should consider increasing the cache timeouts and/or capacity limits", + value = "A soft-locked cache entry in region [%s] with key [%s] was expired by the underlying cache." + + " If this happens regularly, consider increasing the cache timeouts and/or capacity limits.", id = NAMESPACE + 5 ) void softLockedCacheExpired(String regionName, Object key); @LogMessage(level = WARN) @Message( - value = "Missing cache[%1$s] was created on-the-fly." + - " The created cache will use a provider-specific default configuration:" + - " make sure you defined one." + - " You can disable this warning by setting '%2$s' to '%3$s'.", + value = "Missing cache region [%1$s] was created with provider-specific default policies." + + " Explicitly configure the region and its policies, or disable this warning by setting '%2$s' to '%3$s'.", id = NAMESPACE + 6 ) @SuppressWarnings( "unused" ) // used by hibernate-jcache @@ -90,7 +83,7 @@ public interface SecondLevelCacheLogger extends BasicLogger { @LogMessage(level = WARN) @Message( value = "Using legacy cache name [%2$s] because configuration could not be found for cache [%1$s]." + - " Update your configuration to rename cache [%2$s] to [%1$s].", + " Update configuration to rename cache [%2$s] to [%1$s].", id = NAMESPACE + 7 ) @SuppressWarnings( "unused" ) // used by hibernate-jcache @@ -98,11 +91,11 @@ public interface SecondLevelCacheLogger extends BasicLogger { @LogMessage(level = WARN) @Message( - value = "Cache [%1$s] uses the [%2$s] access type, but [%3$s] does not support it natively." + - " Make sure your cache implementation supports JTA transactions.", + value = "Cache region [%1$s] has the access type '%2$s' which is not supported by [%3$s]." + + " Ensure cache implementation supports JTA transactions.", id = NAMESPACE + 8 ) @SuppressWarnings( "unused" ) // used by hibernate-jcache - void nonStandardSupportForAccessType(String key, String accessType, String regionName); + void nonStandardSupportForAccessType(String regionName, String accessType, String regionFactoryClass); } diff --git a/hibernate-core/src/main/java/org/hibernate/cache/spi/support/EntityReadOnlyAccess.java b/hibernate-core/src/main/java/org/hibernate/cache/spi/support/EntityReadOnlyAccess.java index 650ff08fd27f..be8089d3a929 100644 --- a/hibernate-core/src/main/java/org/hibernate/cache/spi/support/EntityReadOnlyAccess.java +++ b/hibernate-core/src/main/java/org/hibernate/cache/spi/support/EntityReadOnlyAccess.java @@ -31,7 +31,7 @@ public EntityReadOnlyAccess( EntityDataCachingConfig config) { super( region, cacheKeysFactory, storageAccess ); if ( config.isMutable() ) { - L2CACHE_LOGGER.readOnlyCachingMutableEntity( config.getNavigableRole() ); + L2CACHE_LOGGER.readOnlyCachingMutableEntity( config.getNavigableRole().getFullPath() ); } } diff --git a/hibernate-core/src/main/java/org/hibernate/cache/spi/support/NaturalIdReadOnlyAccess.java b/hibernate-core/src/main/java/org/hibernate/cache/spi/support/NaturalIdReadOnlyAccess.java index f7aad1f108b6..1869d6965378 100644 --- a/hibernate-core/src/main/java/org/hibernate/cache/spi/support/NaturalIdReadOnlyAccess.java +++ b/hibernate-core/src/main/java/org/hibernate/cache/spi/support/NaturalIdReadOnlyAccess.java @@ -27,7 +27,7 @@ public NaturalIdReadOnlyAccess( NaturalIdDataCachingConfig config) { super( region, keysFactory, storageAccess, config ); if ( config.isMutable() ) { - L2CACHE_LOGGER.readOnlyCachingMutableNaturalId( config.getNavigableRole() ); + L2CACHE_LOGGER.readOnlyCachingMutableNaturalId( config.getNavigableRole().getFullPath() ); } } diff --git a/hibernate-core/src/main/java/org/hibernate/resource/beans/internal/BeansMessageLogger.java b/hibernate-core/src/main/java/org/hibernate/resource/beans/internal/BeansMessageLogger.java index 83b9c8e8364b..ecb81ab22c9c 100644 --- a/hibernate-core/src/main/java/org/hibernate/resource/beans/internal/BeansMessageLogger.java +++ b/hibernate-core/src/main/java/org/hibernate/resource/beans/internal/BeansMessageLogger.java @@ -26,7 +26,7 @@ @ValidIdRange( min = 10005001, max = 10010000 ) @SubSystemLogging( name = BeansMessageLogger.LOGGER_NAME, - description = "Logging related to Hibernate's support for managed beans (CDI, etc)" + description = "Logging related to managed beans and the BeanContainer (CDI, etc)" ) public interface BeansMessageLogger { String LOGGER_NAME = SubSystemLogging.BASE + ".beans"; @@ -37,8 +37,8 @@ public interface BeansMessageLogger { @Message( id = 10005001, value = "An explicit CDI BeanManager reference [%s] was passed to Hibernate, " + - "but CDI is not available on the Hibernate ClassLoader. This is likely " + - "going to lead to exceptions later on in bootstrap" + "but CDI is not available on the Hibernate ClassLoader. This is likely " + + "going to lead to exceptions later on in bootstrap." ) void beanManagerButCdiNotAvailable(Object cdiBeanManagerReference); diff --git a/hibernate-jcache/src/test/java/org/hibernate/orm/test/jcache/MissingCacheStrategyTest.java b/hibernate-jcache/src/test/java/org/hibernate/orm/test/jcache/MissingCacheStrategyTest.java index 02062834af1f..4fa34e0a4548 100644 --- a/hibernate-jcache/src/test/java/org/hibernate/orm/test/jcache/MissingCacheStrategyTest.java +++ b/hibernate-jcache/src/test/java/org/hibernate/orm/test/jcache/MissingCacheStrategyTest.java @@ -106,7 +106,7 @@ private void doTestMissingCacheStrategyCreateWarn(Consumer