Package org.hibernate.cache

Examples of org.hibernate.cache.QueryCache


    if ( !settings.isQueryCacheEnabled() ) {
      return null;
    }

    synchronized ( allCacheRegions ) {
      QueryCache currentQueryCache = ( QueryCache ) queryCaches.get( regionName );
      if ( currentQueryCache == null ) {
        currentQueryCache = settings.getQueryCacheFactory().getQueryCache( regionName, updateTimestampsCache, settings, properties );
        queryCaches.put( regionName, currentQueryCache );
        allCacheRegions.put( currentQueryCache.getRegion().getName(), currentQueryCache.getRegion() );
      }
      return currentQueryCache;
    }
  }
View Full Code Here


        );
      }
      else {
        synchronized ( allCacheRegions ) {
          if ( settings.isQueryCacheEnabled() ) {
            QueryCache namedQueryCache = ( QueryCache ) queryCaches.get( regionName );
            if ( namedQueryCache != null ) {
              namedQueryCache.clear();
              // TODO : cleanup entries in queryCaches + allCacheRegions ?
            }
          }
        }
      }
View Full Code Here

    public void evictQueryRegions() {
      synchronized ( allCacheRegions ) {
        Iterator regions = queryCaches.values().iterator();
        while ( regions.hasNext() ) {
          QueryCache cache = ( QueryCache ) regions.next();
          cache.clear();
          // TODO : cleanup entries in queryCaches + allCacheRegions ?
        }
      }
    }
View Full Code Here

    if ( settings.isQueryCacheEnabled() )  {
      queryCache.destroy();

      iter = queryCaches.values().iterator();
      while ( iter.hasNext() ) {
        QueryCache cache = (QueryCache) iter.next();
        cache.destroy();
      }
      updateTimestampsCache.destroy();
    }

    settings.getCacheProvider().stop();
View Full Code Here

    if ( !settings.isQueryCacheEnabled() ) {
      return null;
    }

    synchronized (allCacheRegions) {
      QueryCache currentQueryCache = (QueryCache) queryCaches.get(cacheRegion);
      if (currentQueryCache==null) {
        currentQueryCache = settings.getQueryCacheFactory()
          .getQueryCache(cacheRegion, updateTimestampsCache, settings, properties);
        queryCaches.put(cacheRegion, currentQueryCache);
        allCacheRegions.put( currentQueryCache.getRegionName(), currentQueryCache.getCache() );
      }
      return currentQueryCache;
    }
  }
View Full Code Here

      throw new NullPointerException("use the zero-argument form to evict the default query cache");
    }
    else {
      synchronized (allCacheRegions) {
        if ( settings.isQueryCacheEnabled() ) {
          QueryCache currentQueryCache = (QueryCache) queryCaches.get(cacheRegion);
          if ( currentQueryCache != null ) {
            currentQueryCache.clear();
          }
        }
      }
    }
  }
View Full Code Here

      final SessionImplementor session,
      final QueryParameters queryParameters,
      final Set querySpaces,
      final Type[] resultTypes) {
 
    QueryCache queryCache = factory.getQueryCache( queryParameters.getCacheRegion() );
   
    Set filterKeys = FilterKey.createFilterKeys(
        session.getEnabledFilters(),
        session.getEntityMode()
      );
View Full Code Here

        );
      }
      else {
        synchronized ( allCacheRegions ) {
          if ( settings.isQueryCacheEnabled() ) {
            QueryCache namedQueryCache = ( QueryCache ) queryCaches.get( regionName );
            if ( namedQueryCache != null ) {
              namedQueryCache.clear();
              // TODO : cleanup entries in queryCaches + allCacheRegions ?
            }
          }
        }
      }
View Full Code Here

    public void evictQueryRegions() {
      synchronized ( allCacheRegions ) {
        Iterator regions = queryCaches.values().iterator();
        while ( regions.hasNext() ) {
          QueryCache cache = ( QueryCache ) regions.next();
          cache.clear();
          // TODO : cleanup entries in queryCaches + allCacheRegions ?
        }
      }
    }
View Full Code Here

    if ( settings.isQueryCacheEnabled() )  {
      queryCache.destroy();

      iter = queryCaches.values().iterator();
      while ( iter.hasNext() ) {
        QueryCache cache = (QueryCache) iter.next();
        cache.destroy();
      }
      updateTimestampsCache.destroy();
    }

    settings.getRegionFactory().stop();
View Full Code Here

TOP

Related Classes of org.hibernate.cache.QueryCache

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.