List:Commits« Previous MessageNext Message »
From:rburnett Date:May 2 2008 6:09pm
Subject:Connector/NET commit: r1270 - branches/5.0/Driver/Source
View as plain text  
Modified:
   branches/5.0/Driver/Source/MySqlPoolManager.cs
Log:
forgot to apply the last patch to a different area

Modified: branches/5.0/Driver/Source/MySqlPoolManager.cs
===================================================================
--- branches/5.0/Driver/Source/MySqlPoolManager.cs	2008-05-02 16:00:18 UTC (rev 1269)
+++ branches/5.0/Driver/Source/MySqlPoolManager.cs	2008-05-02 16:09:48 UTC (rev 1270)
@@ -64,6 +64,7 @@
             {
                 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
@@ -84,9 +85,18 @@
 			{
 				string key = driver.Settings.GetConnectionString(true);
 				MySqlPool pool = (MySqlPool)pools[key];
-				if (pool == null)
-					throw new MySqlException("Pooling exception: Unable to find original pool for connection");
-				pool.ReleaseConnection(driver);
+
+                // 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);
 			}
 		}
 	}

Thread
Connector/NET commit: r1270 - branches/5.0/Driver/Sourcerburnett2 May