sql - TransactionScope IsolationLevel 未应用于 Azure

标签 sql azure transactionscope

在我们的 Azure 数据库中,存在很多死锁。我们尝试将 TransactionScope 类的隔离级别更改为已提交读和可串行化,但死锁图一直显示隔离级别为已提交读 (2)。我们假设它继续使用已提交读快照隔离级别,这是 SQL Azure 中的默认级别。 我们是否需要进行其他一些设置才能让 SQL Azure 采用我们想要的隔离级别?

事务范围代码:

Dim transOption As Transactions.TransactionOptions = New Transactions.TransactionOptions() transOption.IsolationLevel = Transactions.IsolationLevel.ReadCommited 使用范围作为新的 Transactions.TransactionScope(Transactions.TransactionScopeOption.Required, transOption) ... 范围.完整 结束使用

我们还尝试将事务范围选项的“Required”更改为“RequiresNew”,但没有成功。

最佳答案

USE AdventureWorks2012;
GO    
SET TRANSACTION ISOLATION LEVEL SERIALIZABLE

更多信息:

https://social.technet.microsoft.com/wiki/contents/articles/1639.handling-transactions-in-windows-azure-sql-database.aspx

关于sql - TransactionScope IsolationLevel 未应用于 Azure,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21382023/

相关文章:

mysql - 在存储过程中使用游标循环行 MySQL

xml - 逻辑应用 - XML 转换 - 禁止执行 'document()' 函数?

Azure AD B2C 将用户流与应用程序一对一关联

c# - 在Azure构建期间,想要获取azure pipeline生成的修订号来更新我的项目的FileVersion

linq-to-sql - NOLOCK 与 Linq to SQL 不设置事务隔离级别

c# - 如何在 C# 中修复 SQLite 查询?

mysql - 如何从最大日期子查询列表中选择最大日期

MySQL 查询将多个时间戳记录合并为一个

c# - Azure 存储相关的 API 是否参与 System.Transactions?

c# - 从事务范围调用 WCF 服务方法