From: Date: February 22 2008 9:52pm Subject: Connector/NET commit: r1191 - in branches/5.1: . Driver/Source TestSuite/Source List-Archive: http://lists.mysql.com/commits/42877 X-Bug: 34448 Message-Id: <200802222052.m1MKq74v013289@bk-internal.mysql.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Modified: branches/5.1/CHANGES branches/5.1/Driver/Source/MySqlPromotableTransaction.cs branches/5.1/TestSuite/Source/Transactions.cs Log: - Fixed problem where attempting to use an isolation level other than the default with a transaction scope would use the default instead (bug #34448) Modified: branches/5.1/CHANGES =================================================================== --- branches/5.1/CHANGES 2008-02-22 19:41:59 UTC (rev 1190) +++ branches/5.1/CHANGES 2008-02-22 20:52:07 UTC (rev 1191) @@ -3,6 +3,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 - - Fixed problem with membership provider where FindUserByEmail would fail trying to add Modified: branches/5.1/Driver/Source/MySqlPromotableTransaction.cs =================================================================== --- branches/5.1/Driver/Source/MySqlPromotableTransaction.cs 2008-02-22 19:41:59 UTC (rev 1190) +++ branches/5.1/Driver/Source/MySqlPromotableTransaction.cs 2008-02-22 20:52:07 UTC (rev 1191) @@ -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.1/TestSuite/Source/Transactions.cs =================================================================== --- branches/5.1/TestSuite/Source/Transactions.cs 2008-02-22 19:41:59 UTC (rev 1190) +++ branches/5.1/TestSuite/Source/Transactions.cs 2008-02-22 20:52:07 UTC (rev 1191) @@ -140,7 +140,32 @@ TransactionScopeMultipleInternal(true); } */ + /// + /// Bug #34448 Connector .Net 5.2.0 with Transactionscope doesn´t use specified IsolationLevel + /// + [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 ///