public static void ReleaseConnection(Driver driver) { Debug.Assert(driver != null); MySqlPool pool = driver.Pool; if (pool == null) { return; } pool.ReleaseConnection(driver); }
public static void ReleaseConnection(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.ReleaseConnection(driver); } }