Пример #1
0
 internal static void ClearPool(string connectionString)
 {
     lock (typeof(ConnectionPool))
     {
         // Find the pool identified by connectionString
         if (poolMap == null)
         {
             return;
         }
         ConnectionPool pool = (ConnectionPool)poolMap[connectionString];
         if (pool == null)
         {
             return;
         }
         pool.ClearPool();
     }
 }
Пример #2
0
        internal static void ClearAllPools()
        {
            lock (typeof(ConnectionPool))
            {
                if (poolMap == null)
                {
                    return;
                }

                IDictionaryEnumerator iter = poolMap.GetEnumerator();
                while (iter.MoveNext())
                {
                    ConnectionPool pool = (ConnectionPool)iter.Value;
                    if (pool != null)
                    {
                        pool.ClearPool();
                    }
                }
            }
        }