Skip to content

Commit a9aaf87

Browse files
Zbyněk Roubalíkbrmeyer
authored andcommitted
HHH-7130 Query cache eviction logging
1 parent 2009a94 commit a9aaf87

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

hibernate-core/src/main/java/org/hibernate/internal/CacheImpl.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,9 @@ public boolean containsQuery(String regionName) {
232232
@Override
233233
public void evictDefaultQueryRegion() {
234234
if ( sessionFactory.getSettings().isQueryCacheEnabled() ) {
235+
if ( LOG.isDebugEnabled() ) {
236+
LOG.debugf( "Evicting default query region cache." );
237+
}
235238
sessionFactory.getQueryCache().clear();
236239
}
237240
}
@@ -247,6 +250,9 @@ public void evictQueryRegion(String regionName) {
247250
QueryCache namedQueryCache = queryCaches.get( regionName );
248251
// TODO : cleanup entries in queryCaches + allCacheRegions ?
249252
if ( namedQueryCache != null ) {
253+
if ( LOG.isDebugEnabled() ) {
254+
LOG.debugf( "Evicting query cache, region: %s", regionName );
255+
}
250256
namedQueryCache.clear();
251257
}
252258
}
@@ -257,6 +263,9 @@ public void evictQueryRegions() {
257263
if ( CollectionHelper.isEmpty( queryCaches ) ) {
258264
return;
259265
}
266+
if ( LOG.isDebugEnabled() ) {
267+
LOG.debugf( "Evicting cache of all query regions." );
268+
}
260269
for ( QueryCache queryCache : queryCaches.values() ) {
261270
queryCache.clear();
262271
// TODO : cleanup entries in queryCaches + allCacheRegions ?

0 commit comments

Comments
 (0)