HHH-7130 Query cache eviction logging

This commit is contained in:
Zbyněk Roubalík 2013-10-09 14:35:48 +02:00 committed by Brett Meyer
parent e588d2cd6d
commit aec877adb7
1 changed files with 9 additions and 0 deletions

View File

@ -232,6 +232,9 @@ public class CacheImpl implements CacheImplementor {
@Override @Override
public void evictDefaultQueryRegion() { public void evictDefaultQueryRegion() {
if ( sessionFactory.getSettings().isQueryCacheEnabled() ) { if ( sessionFactory.getSettings().isQueryCacheEnabled() ) {
if ( LOG.isDebugEnabled() ) {
LOG.debugf( "Evicting default query region cache." );
}
sessionFactory.getQueryCache().clear(); sessionFactory.getQueryCache().clear();
} }
} }
@ -247,6 +250,9 @@ public class CacheImpl implements CacheImplementor {
QueryCache namedQueryCache = queryCaches.get( regionName ); QueryCache namedQueryCache = queryCaches.get( regionName );
// TODO : cleanup entries in queryCaches + allCacheRegions ? // TODO : cleanup entries in queryCaches + allCacheRegions ?
if ( namedQueryCache != null ) { if ( namedQueryCache != null ) {
if ( LOG.isDebugEnabled() ) {
LOG.debugf( "Evicting query cache, region: %s", regionName );
}
namedQueryCache.clear(); namedQueryCache.clear();
} }
} }
@ -257,6 +263,9 @@ public class CacheImpl implements CacheImplementor {
if ( CollectionHelper.isEmpty( queryCaches ) ) { if ( CollectionHelper.isEmpty( queryCaches ) ) {
return; return;
} }
if ( LOG.isDebugEnabled() ) {
LOG.debugf( "Evicting cache of all query regions." );
}
for ( QueryCache queryCache : queryCaches.values() ) { for ( QueryCache queryCache : queryCaches.values() ) {
queryCache.clear(); queryCache.clear();
// TODO : cleanup entries in queryCaches + allCacheRegions ? // TODO : cleanup entries in queryCaches + allCacheRegions ?