示例#1
0
 public void SecondLevelCacheMiss(string regionName)
 {
     lock (SyncRoot)
     {
         SecondLevelCacheStatistics slc = GetSecondLevelCacheStatistics(regionName);
         if (slc != null)
         {
             secondLevelCacheMissCount++;
             slc.missCount++;
         }
     }
 }
 public void SecondLevelCacheHit(string regionName)
 {
     lock (_syncRoot)
     {
         SecondLevelCacheStatistics slc = GetSecondLevelCacheStatistics(regionName);
         if (slc != null)
         {
             secondLevelCacheHitCount++;
             slc.hitCount++;
         }
     }
 }
示例#3
0
 public void QueryCachePut(string hql, string regionName)
 {
     lock (SyncRoot)
     {
         queryCachePutCount++;
         if (hql != null)
         {
             QueryStatistics qs = GetQueryStatistics(hql);
             qs.cachePutCount++;
         }
         SecondLevelCacheStatistics slcs = GetSecondLevelCacheStatistics(regionName);
         if (slcs != null)
         {
             slcs.putCount++;
         }
     }
 }
示例#4
0
        public SecondLevelCacheStatistics GetSecondLevelCacheStatistics(string regionName)
        {
            lock (SyncRoot)
            {
                SecondLevelCacheStatistics slcs;

                if (!secondLevelCacheStatistics.TryGetValue(regionName, out slcs))
                {
                    if (sessionFactory == null)
                    {
                        return(null);
                    }
                    ICache cache = sessionFactory.GetSecondLevelCacheRegion(regionName);
                    if (cache == null)
                    {
                        return(null);
                    }
                    slcs = new SecondLevelCacheStatistics(cache);
                    secondLevelCacheStatistics[regionName] = slcs;
                }
                return(slcs);
            }
        }
示例#5
0
		public SecondLevelCacheStatistics GetSecondLevelCacheStatistics(string regionName)
		{
			lock (SyncRoot)
			{
				SecondLevelCacheStatistics slcs;

				if (!secondLevelCacheStatistics.TryGetValue(regionName, out slcs))
				{
					if (sessionFactory == null)
						return null;
					ICache cache = sessionFactory.GetSecondLevelCacheRegion(regionName);
					if (cache == null)
						return null;
					slcs = new SecondLevelCacheStatistics(cache);
					secondLevelCacheStatistics[regionName] = slcs;
				}
				return slcs;
			}
		}