public void Clear() { foreach (var region in _cache.GetSystemRegions()) { _cache.ClearRegion(region); } }
public static void Flush(this DataCache cache) { foreach (var region in cache.GetSystemRegions()) { cache.ClearRegion(region); } }
/// <summary> /// Clears the specified domain cache entries. /// </summary> /// <param name="domain">The domain. May not be null.</param> public void Clear(string domain) { if (domain == null) { throw new ArgumentNullException("domain"); } if (!Enabled) { return; } try { Cache.ClearRegion(BuildRegionName(domain)); } catch (DataCacheException ex) { if (IsRegionNotFoundException(ex)) { return; } throw; } }
/// <summary> /// Clear the Cache /// </summary> /// <exception cref="T:NHibernate.Cache.CacheException"></exception> public void Clear() { //remove the root cache item, this will cause all of the individual items to be removed from the cache _webCache.ClearRegion(RegionName); Log.Debug("All items cleared from the cache."); }
/// <summary> /// Flush the cache (clearing all regions) /// </summary> public void Flush() { foreach (string regionName in _dc.GetSystemRegions()) { _dc.ClearRegion(regionName); } }
//Clear public void Clear(DataCacheType type) { DataCache dc = GetDataCache(type.ToString()); foreach (string regionName in dc.GetSystemRegions()) { dc.ClearRegion(regionName); } }
public void Clear() { if (_logger.IsDebugEnabled) { _logger.DebugFormat("Clear() invoked in region '{0}'.", _regionAlphaNumeric); } _cache.ClearRegion(_regionAlphaNumeric); }
/// <summary> /// Invalidates all data on the cache. /// </summary> public void FlushAll() { var regions = DataCache.GetSystemRegions(); foreach (var region in regions) { DataCache.ClearRegion(region); } }
private void clearRegion(string region) { try { _cache.ClearRegion(region); } catch (Exception) { } }
// This deletes all object from the specified region. public void ClearRegion(string region) { GetCache(); if (RegionExists(Convert.ToString(ConfigurationManager.AppSettings[region]).Split('_')[1], Convert.ToString(ConfigurationManager.AppSettings[region]).Split('_')[0])) { _cache.ClearRegion(region); // By this command DefaultCacheItem would also get cleared. Hence we are inserting it again as shown below. // This cacheItem would be active in region till 1 year. _cache.Add(Convert.ToString(ConfigurationManager.AppSettings[region]).Split('_')[1], "DefaultValue", new TimeSpan(365, 24, 60, 60, 0), Convert.ToString(ConfigurationManager.AppSettings[region]).Split('_')[0]); } }
//Clear public void Clear(DataCacheType type, out List <string> keys) { keys = new List <string>(); DataCache dc = GetDataCache(type.ToString()); foreach (string regionName in dc.GetSystemRegions()) { keys.AddRange(dc.GetObjectsInRegion(regionName).ToList().Select(a => a.Key)); dc.ClearRegion(regionName); } }
public void ClearAll() { try { // if in Azure, currently this throws an exception and therefore clear the cache is // not available currently in Azure. var regions = _cache.GetSystemRegions(); foreach (string regionName in regions) { _cache.ClearRegion(regionName); } } catch (Exception ex) { _logger.WriteException(ex); _logger.WriteInfoMessage("Clearing the cache cannot be performed, not currently support by Windows Azure"); } }
private void btnClearnAllObjectFromRegion_Click(object sender, EventArgs e) { try { List <string> ObjectUpdateList = new List <string>(); DialogResult dialogResult = MessageBox.Show("Are you sure you want to clear objects from all regions?", "Dangerous Operation", MessageBoxButtons.YesNo); if (dialogResult == DialogResult.Yes) { if (lstRegions.SelectedItem.ToString() != null) { myCache.ClearRegion(lstRegions.SelectedItem.ToString()); } lstboxGuidCache.Items.Clear(); BuildAllObjectsFromAllRegionList(); } } catch (Exception ex) { HandleException(ex); } }
public void ClearAll() { try { // if in Azure, currently this throws an exception and therefore clear the cache is // not available currently in Azure. var regions = _cache.GetSystemRegions(); foreach (string regionName in regions) { _cache.ClearRegion(regionName); } if (_factory.IsLocalCacheEnabled) { // If local cache is enabled then ensures that local cache is destroyed _cache = null; _cache = _factory.ConstructCache(); } } catch (Exception ex) { _logger.WriteException(ex); _logger.WriteInfoMessage("Clearing the cache cannot be performed, not currently support by Windows Azure"); } }
public void Clear() { _cache.ClearRegion(AppFabricCacheName); }
public void Clear() { cache.ClearRegion(CacheRegion); }
public void Clear() { _cache.ClearRegion(_regionName); }
public void RemoveAll() { Logger.Debug("RemoveAll() invoked in region '{0}'.", _regionAlphaNumeric); _cache.ClearRegion(_regionAlphaNumeric); }
public void Flush() { _Cache.ClearRegion(REGION_NAME); }
/// <summary> /// Çå¿ÕËùÓлº´æÏîÄ¿ /// </summary> public void Clear() { using (new WriterLockSlimDisposable(locker)) { _cache.ClearRegion(RegionName); } }