mirror of
https://github.com/hibernate/hibernate-orm
synced 2025-02-27 14:30:16 +00:00
HHH-7130 Query cache eviction logging
This commit is contained in:
parent
2009a940b6
commit
a9aaf87861
@ -232,6 +232,9 @@ public boolean containsQuery(String regionName) {
|
||||
@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 void evictQueryRegion(String regionName) {
|
||||
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 void evictQueryRegions() {
|
||||
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 ?
|
||||
|
Loading…
x
Reference in New Issue
Block a user