示例#1
0
        private static void Main()
        {
            var poolObject = DbPoolConnection.GetInstance(5);

            poolObject.GetDatabaseConnection();
            Console.ReadLine();
        }
示例#2
0
 // retrieve instance of DbPoolConnection
 public static DbPoolConnection getInstance(int key)
 {
     lock (instances)
     {
         DbPoolConnection instance = null;
         if (!instances.ContainsKey(key))
         {
             instance = new DbPoolConnection();
             instances.Add(key, instance);
         }
         else
         {
             instance = instances[key];
         }
         return(instance);
     }
 }