Example #1
0
        public static void RemoveConnection(Driver driver)
        {
            Debug.Assert(driver != null);

            MySqlPool pool = driver.Pool;

            if (pool == null)
            {
                return;
            }

            pool.RemoveConnection(driver);
        }
Example #2
0
        public static void RemoveConnection(Driver driver)
        {
            string    key  = driver.Settings.GetConnectionString(true);
            MySqlPool pool = (MySqlPool)pools[key];

            // if we can't find the pool but we did get a thread id then we assume
            // something is bad wrong.  If we didn't get a thread id then we assume that
            // the driver connection info was bogus and that led to the pool failing
            // to create
            if (pool == null)
            {
                if (driver.ThreadID != -1)
                {
                    throw new MySqlException("Pooling exception: Unable to find original pool for connection");
                }
            }
            else
            {
                pool.RemoveConnection(driver);
            }
        }