【问题标题】:TransactionScope IsolationLevel not applied in AzureTransactionScope IsolationLevel 未在 Azure 中应用
【发布时间】:2014-01-27 13:21:56
【问题描述】:

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

事务范围代码:

Dim transOption As Transactions.TransactionOptions = New Transactions.TransactionOptions() transOption.IsolationLevel = Transactions.IsolationLevel.ReadCommitted Using scope As New Transactions.TransactionScope(Transactions.TransactionScopeOption.Required, transOption) ... scope.Complete End Using

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

【问题讨论】:

    标签: sql azure transactionscope


    【解决方案1】:
    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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-10-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-04-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多