Transaction Isolation Level is ignored

Transaction Isolation Level is ignored

Postby jleblanc » Tue 19 Apr 2016 23:31

I've noticed that when using transactions with dotConnect, the isolation level on my TransactionScope is being ignored. I'm using Devart DotConnect MySQL version 8.4.616.0; here's some sample code:

Code: Select all
public static void PrintIsolationLevel(string connectionString)
{
   using (var scope = new TransactionScope(TransactionScopeOption.Required, new TransactionOptions{IsolationLevel = IsolationLevel.ReadUncommitted}))
   using (var connection = new MySqlConnection(connectionString))
   {
      connection.Open();
      using (var command = connection.CreateCommand())
      {
         command.CommandText = "SHOW VARIABLES LIKE 'tx_isolation';";
         using (var reader = command.ExecuteReader())
         {
            while (reader.Read())
            {
               var level = reader.GetString(1);
               Console.WriteLine("TransactionScope Isolation level {0}",Transaction.Current.IsolationLevel);
               Console.WriteLine("Database isolation level {0}", level);
            }
         }
      }
   }
}


When I run this function using dotConnect, I see this output:

Code: Select all
TransactionScope Isolation level ReadUncommitted
Database isolation level REPEATABLE-READ


When I run the same function using MySQL's Connector/Net, I see this output:

Code: Select all
TransactionScope Isolation level ReadUncommitted
Database isolation level READ-UNCOMMITTED


This is related to my other post on deadlocks; we're trying to control the isolation level of things that do not need strict concurrency, but it appears that dotConnect is ignoring us.

Any ideas?
jleblanc
 
Posts: 14
Joined: Tue 19 Apr 2016 22:31

Re: Transaction Isolation Level is ignored

Postby Shalex » Tue 26 Apr 2016 06:27

We have reproduced the issue and are investigating it. We will notify you about the result.
Shalex
Devart Team
 
Posts: 7536
Joined: Thu 14 Aug 2008 12:44

Re: Transaction Isolation Level is ignored

Postby Shalex » Thu 28 Apr 2016 11:25

The bug with prolongating an isolation level of ambient TransactionScope to the enlisted connection session is fixed. We will notify you when the corresponding build of dotConnect for MySQL is available for download.
Shalex
Devart Team
 
Posts: 7536
Joined: Thu 14 Aug 2008 12:44

Re: Transaction Isolation Level is ignored

Postby jleblanc » Thu 28 Apr 2016 16:40

Fantastic!
jleblanc
 
Posts: 14
Joined: Tue 19 Apr 2016 22:31

Re: Transaction Isolation Level is ignored

Postby Shalex » Fri 06 May 2016 08:26

New build of dotConnect for MySQL 8.5.644 is available for download now: http://forums.devart.com/viewtopic.php?f=2&t=33634.
Shalex
Devart Team
 
Posts: 7536
Joined: Thu 14 Aug 2008 12:44

Re: Transaction Isolation Level is ignored

Postby jleblanc » Mon 09 May 2016 23:03

Thanks, we're upgrading now.
jleblanc
 
Posts: 14
Joined: Tue 19 Apr 2016 22:31

Re: Transaction Isolation Level is ignored

Postby jleblanc » Wed 11 May 2016 18:12

This is resolved, thanks!
jleblanc
 
Posts: 14
Joined: Tue 19 Apr 2016 22:31


Return to dotConnect for MySQL