public void evictDefaultQueryRegion() { if ( settings.isQueryCacheEnabled() ) { queryCache.clear(); } }
public void evictQueryRegion(String regionName) { if (regionName == null) throw new NullPointerException( "Region-name cannot be null (use Cache#evictDefaultQueryRegion to evict the default query cache)"); if (settings.isQueryCacheEnabled()) { QueryCache namedQueryCache = queryCaches.get(regionName); // TODO : cleanup entries in queryCaches + allCacheRegions ? if (namedQueryCache != null) namedQueryCache.clear(); } }
public void evictQueries() throws HibernateException { if ( settings.isQueryCacheEnabled() ) { queryCache.clear(); } }
public void evictDefaultQueryRegion() { if ( settings.isQueryCacheEnabled() ) { queryCache.clear(); } }
public void evictQueryRegion(String regionName) { if (regionName == null) throw new NullPointerException( "Region-name cannot be null (use Cache#evictDefaultQueryRegion to evict the default query cache)"); if (settings.isQueryCacheEnabled()) { QueryCache namedQueryCache = queryCaches.get(regionName); // TODO : cleanup entries in queryCaches + allCacheRegions ? if (namedQueryCache != null) namedQueryCache.clear(); } }
public void evictQueries() throws HibernateException { if ( settings.isQueryCacheEnabled() ) { queryCache.clear(); } }
public void evictQueries() throws HibernateException { if ( settings.isQueryCacheEnabled() ) { queryCache.clear(); } }
public void evictQueries() throws HibernateException { if ( settings.isQueryCacheEnabled() ) { queryCache.clear(); } }
public void evictQueries(String cacheRegion) throws HibernateException { if (cacheRegion==null) { 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(); } } } }
public void evictQueries(String cacheRegion) throws HibernateException { if (cacheRegion==null) { 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(); } } } } }
public QueryCache getQueryCache(String cacheRegion) throws HibernateException { if (cacheRegion==null) { return getQueryCache(); } 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; } }
public QueryCache getQueryCache(String cacheRegion) throws HibernateException { if (cacheRegion==null) { return getQueryCache(); } 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; } }
/** * Return the query results, using the query cache, called * by subclasses that implement cacheable queries */ protected List list( final SessionImplementor session, final QueryParameters queryParameters, final Set querySpaces, final Type[] resultTypes) throws HibernateException { final boolean cacheable = factory.getSettings().isQueryCacheEnabled() && queryParameters.isCacheable(); if ( cacheable ) { return listUsingQueryCache( session, queryParameters, querySpaces, resultTypes ); } else { return listIgnoreQueryCache( session, queryParameters ); } }
public void afterTransactionCompletion(boolean success) { for ( AfterTransactionCompletionProcess process : processes ) { try { process.doAfterTransactionCompletion( success, session ); } catch ( CacheException ce ) { LOG.unableToReleaseCacheLock( ce ); // continue loop } catch ( Exception e ) { throw new AssertionFailure( "Exception releasing cache locks", e ); } } processes.clear(); if ( session.getFactory().getSettings().isQueryCacheEnabled() ) { session.getFactory().getUpdateTimestampsCache().invalidate( querySpacesToInvalidate.toArray( new String[ querySpacesToInvalidate.size()] ) ); } querySpacesToInvalidate.clear(); } }
/** * Return the query results, using the query cache, called * by subclasses that implement cacheable queries */ protected List list( final SessionImplementor session, final QueryParameters queryParameters, final Set querySpaces, final Type[] resultTypes) throws HibernateException { final boolean cacheable = factory.getSettings().isQueryCacheEnabled() && queryParameters.isCacheable(); if ( cacheable ) { return listUsingQueryCache( session, queryParameters, querySpaces, resultTypes ); } else { return listIgnoreQueryCache( session, queryParameters ); } }
/** * Return the query results, using the query cache, called * by subclasses that implement cacheable queries */ protected List list( final SessionImplementor session, final QueryParameters queryParameters, final Set querySpaces, final Type[] resultTypes) throws HibernateException { final boolean cacheable = factory.getSettings().isQueryCacheEnabled() && queryParameters.isCacheable(); if ( cacheable ) { return listUsingQueryCache( session, queryParameters, querySpaces, resultTypes ); } else { return listIgnoreQueryCache( session, queryParameters ); } }
public void execute(Executable executable) { final boolean lockQueryCache = session.getFactory().getSettings().isQueryCacheEnabled(); if ( executable.hasAfterTransactionCompletion() || lockQueryCache ) { executions.add( executable ); } if (lockQueryCache) { session.getFactory() .getUpdateTimestampsCache() .preinvalidate( executable.getPropertySpaces() ); } executable.execute(); }
public void execute(Executable executable) { final boolean lockQueryCache = session.getFactory().getSettings().isQueryCacheEnabled(); if ( executable.hasAfterTransactionCompletion() || lockQueryCache ) { executions.add( executable ); } if (lockQueryCache) { session.getFactory() .getUpdateTimestampsCache() .preinvalidate( executable.getPropertySpaces() ); } executable.execute(); }
private void registerCleanupActions(Executable executable) { beforeTransactionProcesses.register( executable.getBeforeTransactionCompletionProcess() ); if ( session.getFactory().getSettings().isQueryCacheEnabled() ) { final String[] spaces = (String[]) executable.getPropertySpaces(); if ( spaces != null && spaces.length > 0 ) { //HHH-6286 afterTransactionProcesses.addSpacesToInvalidate( spaces ); session.getFactory().getUpdateTimestampsCache().preinvalidate( spaces ); } } afterTransactionProcesses.register( executable.getAfterTransactionCompletionProcess() ); }
private void registerCleanupActions(Executable executable) { beforeTransactionProcesses.register( executable.getBeforeTransactionCompletionProcess() ); if ( session.getFactory().getSettings().isQueryCacheEnabled() ) { final String[] spaces = (String[]) executable.getPropertySpaces(); if ( spaces != null && spaces.length > 0 ) { //HHH-6286 afterTransactionProcesses.addSpacesToInvalidate( spaces ); session.getFactory().getUpdateTimestampsCache().preinvalidate( spaces ); } } afterTransactionProcesses.register( executable.getAfterTransactionCompletionProcess() ); }