Transaction Isolation Level is ignored

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for MySQL
Post Reply
jleblanc
Posts: 14
Joined: Tue 19 Apr 2016 22:31

Transaction Isolation Level is ignored

Post by 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?

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: Transaction Isolation Level is ignored

Post by Shalex » Tue 26 Apr 2016 06:27

We have reproduced the issue and are investigating it. We will notify you about the result.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: Transaction Isolation Level is ignored

Post by 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.

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

Re: Transaction Isolation Level is ignored

Post by jleblanc » Thu 28 Apr 2016 16:40

Fantastic!

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: Transaction Isolation Level is ignored

Post by 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.

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

Re: Transaction Isolation Level is ignored

Post by 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

Post by jleblanc » Wed 11 May 2016 18:12

This is resolved, thanks!

Post Reply