From aec877adb7875dc29e68136a489a9bc24c6a9bfb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbyn=C4=9Bk=20Roubal=C3=ADk?= Date: Wed, 9 Oct 2013 14:35:48 +0200 Subject: [PATCH] HHH-7130 Query cache eviction logging --- .../src/main/java/org/hibernate/internal/CacheImpl.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/hibernate-core/src/main/java/org/hibernate/internal/CacheImpl.java b/hibernate-core/src/main/java/org/hibernate/internal/CacheImpl.java index d9cbc92749..d823ab5583 100644 --- a/hibernate-core/src/main/java/org/hibernate/internal/CacheImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/internal/CacheImpl.java @@ -232,6 +232,9 @@ public class CacheImpl implements CacheImplementor { @Override public void evictDefaultQueryRegion() { if ( sessionFactory.getSettings().isQueryCacheEnabled() ) { + if ( LOG.isDebugEnabled() ) { + LOG.debugf( "Evicting default query region cache." ); + } sessionFactory.getQueryCache().clear(); } } @@ -247,6 +250,9 @@ public class CacheImpl implements CacheImplementor { QueryCache namedQueryCache = queryCaches.get( regionName ); // TODO : cleanup entries in queryCaches + allCacheRegions ? if ( namedQueryCache != null ) { + if ( LOG.isDebugEnabled() ) { + LOG.debugf( "Evicting query cache, region: %s", regionName ); + } namedQueryCache.clear(); } } @@ -257,6 +263,9 @@ public class CacheImpl implements CacheImplementor { if ( CollectionHelper.isEmpty( queryCaches ) ) { return; } + if ( LOG.isDebugEnabled() ) { + LOG.debugf( "Evicting cache of all query regions." ); + } for ( QueryCache queryCache : queryCaches.values() ) { queryCache.clear(); // TODO : cleanup entries in queryCaches + allCacheRegions ?