SQLException 死锁:异常是否包含在某处执行的查询文本?

发布于 2024-10-05 09:38:18 字数 100 浏览 0 评论 0原文

SQLException“与另一个进程在锁资源上发生死锁,并被选为死锁受害者”很常见;-)

该异常是否包含在某处执行的查询文本? 可以获得吗?

Thks

The SQLException "was deadlocked on lock resources with another process and has been chosen as the deadlock victim" is quite common ;-)

Does the exception contains the query text executed somewhere ?
Is it possible to obtain ?

Thks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

2024-10-12 09:38:18

是的,但不是你的例外。你应该知道你做了什么——异常只是告诉你你陷入了僵局。你应该知道此时你正在执行什么 SQL。

对于其余部分,请使用查询分析器和从服务器获取的其他信息(检查 http://support.microsoft .com/kb/832524 获取一些提示,或 http://msdn.microsoft.com/en-us/library/aa937573(v=SQL.80).aspx 来找出导致死锁的其他脚本。不过,这对于非常明显的安全原因,只有阿丁才会做的事情。

Yes, but not in your exception. You SHOULD KNOW WHAT YOU DID - and the exception just tells you that YOU Deadlocked. You should know what SQL youwere executing at this moment.

For the rest, use the query profiler and other information you obtain from teh server (check http://support.microsoft.com/kb/832524 for some tips, or http://msdn.microsoft.com/en-us/library/aa937573(v=SQL.80).aspx to find out what OTHER scripts you deadlock with. THis is, though, for very obbvious security reasons, something onl adins do.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文