Пример #1
0
 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);
     }
 }
Пример #3
0
        /// <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;
            }
        }
Пример #4
0
        /// <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);
            }
        }
Пример #7
0
        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);
            }
        }
Пример #9
0
 private void clearRegion(string region)
 {
     try
     {
         _cache.ClearRegion(region);
     }
     catch (Exception)
     {
     }
 }
Пример #10
0
        // 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");
     }
 }
Пример #13
0
        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);
            }
        }
Пример #14
0
        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");
            }
        }
Пример #15
0
 public void Clear()
 {
     _cache.ClearRegion(AppFabricCacheName);
 }
Пример #16
0
 public void Clear()
 {
     cache.ClearRegion(CacheRegion);
 }
 public void Clear()
 {
     _cache.ClearRegion(_regionName);
 }
Пример #18
0
 public void RemoveAll()
 {
     Logger.Debug("RemoveAll() invoked in region '{0}'.", _regionAlphaNumeric);
     _cache.ClearRegion(_regionAlphaNumeric);
 }
Пример #19
0
 public void Flush()
 {
     _Cache.ClearRegion(REGION_NAME);
 }
Пример #20
0
 /// <summary>
 /// Çå¿ÕËùÓлº´æÏîÄ¿
 /// </summary>
 public void Clear()
 {
     using (new WriterLockSlimDisposable(locker)) { _cache.ClearRegion(RegionName); }
 }