Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transaction isolation levels are not supported for special databases #772

Closed
ich-wangxf opened this issue Mar 1, 2020 · 3 comments
Closed

Comments

@ich-wangxf
Copy link

ich-wangxf commented Mar 1, 2020

I‘m a developer in China, When I use the aliyun Distributed Relational Database Service (https://help.aliyun.com/product/29657.html), the product does not support the transaction isolation level, only supports basic transaction, for example "start transaction",hope can through configuration to decide whether to enable the transaction isolation level, at present can only solve by modifying the key code, the code is as follows

`using (var cmd = new MySqlCommand("start transaction;", this))

//using (var cmd = new MySqlCommand("set transaction isolation level " + isolationLevelValue + "; start transaction;", this))
await cmd.ExecuteNonQueryAsync(ioBehavior, cancellationToken).ConfigureAwait(false);`

@billsking
Copy link

I have the same problem. It may be more flexible to change it to a configurable way.

@bgrainger
Copy link
Member

What do you think of the following possible solution: if BeginTransaction is called with IsolationLevel.Unspecified then the set transaction isolation level X command is not emitted?

That is, using IsolationLevel.Unspecified (which is the default) will use the database's default isolation level. An explicit IsolationLevel value would have to be passed to BeginTransaction in order to send a set transaction isolation level X command and set the isolation level.

@ich-wangxf
Copy link
Author

What do you think of the following possible solution: if BeginTransaction is called with IsolationLevel.Unspecified then the set transaction isolation level X command is not emitted?

That is, using IsolationLevel.Unspecified (which is the default) will use the database's default isolation level. An explicit IsolationLevel value would have to be passed to BeginTransaction in order to send a set transaction isolation level X command and set the isolation level.

May I ask how to disable the default transaction isolation level? When I transfer the key code in your component ("set transaction isolation level "+ isolationLevelValue + ";Start the transaction.") to "start transaction", use the Aliyun DRDS can be used normally. Of course, I also consulted the database engineer of Aliyun, and they replied that "set transaction isolation level repeatable read;start start transaction" is not supported; "set transaction isolation level repeatable read" this transaction level is invalid in the DRDS setting, and only the " start transaction" can be used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants