コード例 #1
0
        public override void Close()
        {
            if (connection != null)
            {
                connection.Close();
            }

            if (dataReader != null)
            {
                dataReader = null;
            }

            ChangeState(ConnectionState.Closed);
        }
コード例 #2
0
ファイル: TdsConnectionPool.cs プロジェクト: fangld/MapleDB
 public static void Clear()
 {
     Console.WriteLine("Pool clear start!");
     timer.Stop();
     contentLock.AcquireWriterLock(-1);
     foreach (LinkedList <ITdsConnection> list in contents.Values)
     {
         while (list.Count != 0)
         {
             LinkedListNode <ITdsConnection> node = list.First;
             ITdsConnection connection            = node.Value;
             list.RemoveFirst();
             connection.Close();
         }
     }
     contentLock.ReleaseWriterLock();
     timer.Start();
     Console.WriteLine("Pool clear end!");
 }