Sql事务中的问题 [英] Problem in Sql Transaction

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

问题描述

Hello There



我有一个C#应用程序,我在其中使用SQL事务。

如果我们在表格中进行更改(在开始交易之后)并再次重复使用相同的表格,则系统不允许进行更改并停止工作。

所以我想知道是否有任何替代解决方案可以做同样的事情,因为我甚至无法从该表中获取数据。



需要建议

最好的问候

Hello There

I have a C# application in which I am using SQL transaction.
At a point if we make changes in a table (after begin transaction) and again reuse of same table then the system not allow to make changes and it stops working.
So I want to know is there any alternate solution available to do the same because I can''t even fetch the data from that table.

Need Suggestion
Best Regards

推荐答案

根据描述,听起来你有锁定碰撞甚至僵局。



尝试从SSMS调查停止的会话正在等待什么。为此,您可以使用活动监视器或查询 sys.dm_tran_locks [ ^ ]
Based on the description, it sounds like you''re having either a lock collision or even a deadlock.

Try investigating from SSMS what the halted session is waiting for. For this you can use either activity monitor or query sys.dm_tran_locks[^]


我的事首先,您在表中插入数据,然后使用事务从表中获取相同的数据,意味着在提交之前尝试获取数据,因此首先尝试提交获取数据
i thing First you are inserting data in table and then fetch the same data from table and u r using transaction, means before committing you are trying to fetch data, so try to commit first the the fetch data


这篇关于Sql事务中的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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