From: Date: December 8 2006 9:54pm Subject: Connector/NET commit: r488 - in branches/1.0: . mysqlclient List-Archive: http://lists.mysql.com/commits/16694 X-Bug: 24661 Message-Id: <200612082054.kB8Kshnt029639@bk-internal.mysql.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Modified: branches/1.0/CHANGES branches/1.0/mysqlclient/Driver.cs branches/1.0/mysqlclient/MySqlPool.cs Log: Bug #24661 mysql-connector-net-5.0.2-beta Driver.IsTooOld() Error.... The result of this bug is that if a connection lifetime is set that is > than 60 seconds, the connection would never expire since we were comparing to TimeSpan.Seconds which will never be > 59 seconds. Modified: branches/1.0/CHANGES =================================================================== --- branches/1.0/CHANGES 2006-12-08 20:52:29 UTC (rev 487) +++ branches/1.0/CHANGES 2006-12-08 20:54:42 UTC (rev 488) @@ -8,6 +8,7 @@ Bug #23749 VarChar field size over 255 causes a System.OverflowException Bug #18186 Problem with implementation of PreparedStatement Bug #24565 Inferring DbType fails when reusing commands and the first time the value is nul + Bug #24661 mysql-connector-net-5.0.2-beta Driver.IsTooOld() Error.... Other changes ------------- Modified: branches/1.0/mysqlclient/Driver.cs =================================================================== --- branches/1.0/mysqlclient/Driver.cs 2006-12-08 20:52:29 UTC (rev 487) +++ branches/1.0/mysqlclient/Driver.cs 2006-12-08 20:54:42 UTC (rev 488) @@ -102,7 +102,8 @@ public bool IsTooOld() { TimeSpan ts = DateTime.Now.Subtract(creationTime); - if (ts.Seconds > Settings.ConnectionLifetime) + if (Settings.ConnectionLifetime != 0 && + ts.TotalSeconds > Settings.ConnectionLifetime) return true; return false; } Modified: branches/1.0/mysqlclient/MySqlPool.cs =================================================================== --- branches/1.0/mysqlclient/MySqlPool.cs 2006-12-08 20:52:29 UTC (rev 487) +++ branches/1.0/mysqlclient/MySqlPool.cs 2006-12-08 20:54:42 UTC (rev 488) @@ -143,7 +143,7 @@ lock (inUsePool.SyncRoot) { inUsePool.Remove(driver); - if (driver.Settings.ConnectionLifetime != 0 && driver.IsTooOld()) + if (driver.IsTooOld()) driver.Close(); else idlePool.Enqueue(driver);