Modified:
branches/5.2/CHANGES
branches/5.2/Driver/Source/MySqlPromotableTransaction.cs
branches/5.2/TestSuite/Source/Transactions.cs
Log:
merged from 5.1
Modified: branches/5.2/CHANGES
===================================================================
--- branches/5.2/CHANGES 2008-02-22 20:52:07 UTC (rev 1191)
+++ branches/5.2/CHANGES 2008-02-22 20:54:05 UTC (rev 1192)
@@ -28,6 +28,8 @@
in server explorer. (bug #34359)
- Fixed a problem in procedure cache where it was possible to get into a race condition
and cause a memory leak (bug #34338)
+ - Fixed problem where attempting to use an isolation level other than the default with
+ a transaction scope would use the default instead (bug #34448)
Version 5.1.5 - 2/11/2008
- Fixed problem with membership provider where FindUserByEmail would fail trying to add
Modified: branches/5.2/Driver/Source/MySqlPromotableTransaction.cs
===================================================================
--- branches/5.2/Driver/Source/MySqlPromotableTransaction.cs 2008-02-22 20:52:07 UTC (rev 1191)
+++ branches/5.2/Driver/Source/MySqlPromotableTransaction.cs 2008-02-22 20:54:05 UTC (rev 1192)
@@ -44,7 +44,12 @@
void IPromotableSinglePhaseNotification.Initialize()
{
- simpleTransaction = connection.BeginTransaction();
+ string valueName = Enum.GetName(
+ typeof(System.Transactions.IsolationLevel), baseTransaction.IsolationLevel);
+ System.Data.IsolationLevel dataLevel = (System.Data.IsolationLevel)Enum.Parse(
+ typeof(System.Data.IsolationLevel), valueName);
+
+ simpleTransaction = connection.BeginTransaction(dataLevel);
}
void IPromotableSinglePhaseNotification.Rollback(SinglePhaseEnlistment singlePhaseEnlistment)
Modified: branches/5.2/TestSuite/Source/Transactions.cs
===================================================================
--- branches/5.2/TestSuite/Source/Transactions.cs 2008-02-22 20:52:07 UTC (rev 1191)
+++ branches/5.2/TestSuite/Source/Transactions.cs 2008-02-22 20:54:05 UTC (rev 1192)
@@ -140,7 +140,32 @@
TransactionScopeMultipleInternal(true);
}
*/
+ /// <summary>
+ /// Bug #34448 Connector .Net 5.2.0 with Transactionscope doesn+ /// </summary>
+ [Test]
+ public void TransactionScopeWithIsolationLevel()
+ {
+ TransactionOptions opts = new TransactionOptions();
+ opts.IsolationLevel = System.Transactions.IsolationLevel.ReadCommitted;
+ using (TransactionScope scope = new TransactionScope(TransactionScopeOption.Required, opts))
+ {
+ string connStr = GetConnectionString(true);
+ using (MySqlConnection myconn = new MySqlConnection(connStr))
+ {
+ myconn.Open();
+ MySqlCommand cmd = new MySqlCommand("SHOW VARIABLES LIKE 'tx_isolation'", myconn);
+ using (MySqlDataReader reader = cmd.ExecuteReader())
+ {
+ reader.Read();
+ string level = reader.GetString(1);
+ Assert.AreEqual("READ-COMMITTED", level);
+ }
+ }
+ }
+ }
+
#endif
/// <summary>
| Thread |
|---|
| • Connector/NET commit: r1192 - in branches/5.2: . Driver/Source TestSuite/Source | rburnett | 22 Feb |