Quantcast
Channel: MySQL Forums - Connector/NET and C#, Mono, .Net
Viewing all articles
Browse latest Browse all 1451

MySql.Data version 8.0.31 doesn't set right isolation level (1 reply)

$
0
0
When using MySql.Data version 8.0.31 with .Net 6.0, when the isolation level is set for a command, the command is executed at the default isolation level.

The sample below demonstrates the issue:

[TestMethod]
public void TestBuggyIso()
{
var connection = new MySqlConnection(ConnectionString);
connection.Open();
var transaction = connection.BeginTransaction(System.Data.IsolationLevel.Serializable);
MySqlCommand command = new("SELECT @@transaction_isolation;", connection, transaction);
var reader = command.ExecuteReader();
while (reader.Read())
{
string value = reader.GetString(0);
Assert.AreEqual(value, "SERIALIZABLE");
}
}

Here the isolation level should be Serializable but I see that the isolation level is set to REPEATABLE-READ.

Viewing all articles
Browse latest Browse all 1451

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>