Transactions在concurruncy中解决了死锁问题 [英] Transactionscope deadlocked issue in concurruncy

查看:85
本文介绍了Transactions在concurruncy中解决了死锁问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我收到错误

i'm getting Error as

Transaction (Process ID 64) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction.





同时更新数据库





while Updating Database concurrently

option.IsolationLevel = System.Transactions.IsolationLevel.ReadUncommitted;
option.Timeout = TimeSpan.FromMinutes(1);

<pre lang="c#">using (_objTransactionScope = new TransactionScope(TransactionScopeOption.Required, option))
{
    //..Open Connection
    //..Process the Document
    //..Update Additional information in Table2 about document(Delete/Insert)   
    //..Update Location Information in Table3 about document(Delete/Insert)
    //..Delete the Document in Table4 in Differant Database on Differant Server(WCF Service)
    //..Update the Checksum of the Document and Metadata in Table1(Deadlock Error in concurrency)
    //..Delete Lock Entry From Table5   
    //..Close Connection
    //..Commit Transaction Scope
}





我怎么能解决这个问题



我尝试了什么:

< br $>
检查

https://www.codeproject.com/Answers/515051/BulkplusInsertpluswithplusParallelplusforpluseach#answer1



how i can solve this problem

What I have tried:

checked
https://www.codeproject.com/Answers/515051/BulkplusInsertpluswithplusParallelplusforpluseach#answer1

推荐答案

设计你的d更好的。给它更多的资源。更改事务隔离级别



SET TRANSACTION ISOLATION LEVEL(Transact-SQL) - SQL Server Microsoft Docs [ ^ ]
Design your database better. Give it more resources. Change the transaction isolation level

SET TRANSACTION ISOLATION LEVEL (Transact-SQL) - SQL Server | Microsoft Docs[^]


这篇关于Transactions在concurruncy中解决了死锁问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆