Modified:
trunk/CHANGES
trunk/Driver/Source/Connection.cs
trunk/TestSuite/Source/SimpleTransactions.cs
Log:
Fixed problem where MySqlConnection.BeginTransaction checked the drivers
status var before checking if the connection was open. The result was that the driver could report an invalid condition on a previously opened connection.
Modified: trunk/CHANGES
===================================================================
--- trunk/CHANGES 2007-07-24 00:09:40 UTC (rev 807)
+++ trunk/CHANGES 2007-07-24 00:13:06 UTC (rev 808)
@@ -77,6 +77,12 @@
- Fixed bug where Connecor/Net was hand building some date time patterns rather than using
the patterns provided under CultureInfo. This caused problems with some calendars that do
not support the same ranges as Gregorian. (Bug #29931)
+ - Fixed problem where MySqlConnection.BeginTransaction checked the drivers
+ status var before checking if the connection was open. The result was that the
+ driver could report an invalid condition on a previously opened connection.
+ - Fixed problem where an attempt to open a connection max pool size times while
+ the server is down will prevent any further attempts due to the pool semaphore
+ being full. (Bug #29409)
Version 5.0.7 5/16/2007
Modified: trunk/Driver/Source/Connection.cs
===================================================================
--- trunk/Driver/Source/Connection.cs 2007-07-24 00:09:40 UTC (rev 807)
+++ trunk/Driver/Source/Connection.cs 2007-07-24 00:13:06 UTC (rev 808)
@@ -312,14 +312,14 @@
/// <include file='docs/MySqlConnection.xml' path='docs/BeginTransaction1/*'/>
public new MySqlTransaction BeginTransaction(IsolationLevel iso)
{
+ //TODO: check note in help
+ if (State != ConnectionState.Open)
+ throw new InvalidOperationException(Resources.ConnectionNotOpen);
+
// First check to see if we are in a current transaction
if ((driver.ServerStatus & ServerStatusFlags.InTransaction) != 0)
throw new InvalidOperationException(Resources.NoNestedTransactions);
- //TODO: check note in help
- if (State != ConnectionState.Open)
- throw new InvalidOperationException(Resources.ConnectionNotOpen);
-
MySqlTransaction t = new MySqlTransaction(this, iso);
MySqlCommand cmd = new MySqlCommand("", this);
Modified: trunk/TestSuite/Source/SimpleTransactions.cs
===================================================================
--- trunk/TestSuite/Source/SimpleTransactions.cs 2007-07-24 00:09:40 UTC (rev 807)
+++ trunk/TestSuite/Source/SimpleTransactions.cs 2007-07-24 00:13:06 UTC (rev 808)
@@ -102,5 +102,21 @@
}
}
+ [Test]
+ public void BeginTransactionOnPreviouslyOpenConnection()
+ {
+ string connStr = GetConnectionString(true);
+ MySqlConnection c = new MySqlConnection(connStr);
+ c.Open();
+ c.Close();
+ try
+ {
+ MySqlTransaction t = c.BeginTransaction();
+ }
+ catch (Exception ex)
+ {
+ Assert.AreEqual("The connection is not open.", ex.Message);
+ }
+ }
}
}
| Thread |
|---|
| • Connector/NET commit: r808 - in trunk: . Driver/Source TestSuite/Source | rburnett | 24 Jul |