Page 1 of 1

Transaction Isolation Level is ignored

Posted: Tue 19 Apr 2016 23:31
by jleblanc
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?

Re: Transaction Isolation Level is ignored

Posted: Tue 26 Apr 2016 06:27
by Shalex
We have reproduced the issue and are investigating it. We will notify you about the result.

Re: Transaction Isolation Level is ignored

Posted: Thu 28 Apr 2016 11:25
by Shalex
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.

Re: Transaction Isolation Level is ignored

Posted: Thu 28 Apr 2016 16:40
by jleblanc
Fantastic!

Re: Transaction Isolation Level is ignored

Posted: Fri 06 May 2016 08:26
by Shalex
New build of dotConnect for MySQL 8.5.644 is available for download now: http://forums.devart.com/viewtopic.php?f=2&t=33634.

Re: Transaction Isolation Level is ignored

Posted: Mon 09 May 2016 23:03
by jleblanc
Thanks, we're upgrading now.

Re: Transaction Isolation Level is ignored

Posted: Wed 11 May 2016 18:12
by jleblanc
This is resolved, thanks!