From: Date: December 8 2006 9:52pm Subject: Connector/NET commit: r487 - trunk/mysqlclient/core List-Archive: http://lists.mysql.com/commits/16693 X-Bug: 24661 Message-Id: <200612082052.kB8KqTR8029607@bk-internal.mysql.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Modified: trunk/mysqlclient/core/Driver.cs trunk/mysqlclient/core/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: trunk/mysqlclient/core/Driver.cs =================================================================== --- trunk/mysqlclient/core/Driver.cs 2006-12-08 20:25:47 UTC (rev 486) +++ trunk/mysqlclient/core/Driver.cs 2006-12-08 20:52:29 UTC (rev 487) @@ -106,7 +106,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: trunk/mysqlclient/core/MySqlPool.cs =================================================================== --- trunk/mysqlclient/core/MySqlPool.cs 2006-12-08 20:25:47 UTC (rev 486) +++ trunk/mysqlclient/core/MySqlPool.cs 2006-12-08 20:52:29 UTC (rev 487) @@ -154,7 +154,7 @@ lock ((inUsePool as ICollection).SyncRoot) { inUsePool.Remove(driver); - if (driver.Settings.ConnectionLifeTime != 0 && driver.IsTooOld()) + if (driver.IsTooOld()) driver.Close(); else idlePool.Enqueue(driver);