如何在插入和更新事件期间避免死锁 [英] How to avoid deadlock during Insert and Update Events

查看:160
本文介绍了如何在插入和更新事件期间避免死锁的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hello All,

我们创建了一个连续命中数据库表的API,如果有其他用户尝试在该表上插入或更新任何内容,那么我们就会遇到死锁问题。那么我们如何避免插入死锁,同时API也将数据插入到该表中



我收到以下异常:

交易(进程ID XXX)在锁定通信缓冲区资源上与另一个进程死锁,并被选为死锁牺牲品。重新运行事务





谢谢,

Amit

Hello All,
We have created an API that is continuous hitting the database table and if anyone other user try to insert or update anything on that table then we are getting deadlock issue. So how we can avoid deadlock for inserting while the API also inserting data to that table

I am getting the following exception:
"Transaction (Process ID XXX) was deadlocked on lock | communication buffer resources with another process and has been chosen as the deadlock victim. Rerun the transaction"


Thanks,
Amit

推荐答案

如何遵循Technet文档中的指导说明;

尽量减少死锁 [ ^ ]
How about following the guidance notes in the Technet document;
Minimizing Deadlocks[^]


这篇关于如何在插入和更新事件期间避免死锁的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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