发生死锁时 ODBC 会发生什么情况?

发布于 2024-09-12 17:41:49 字数 285 浏览 0 评论 0原文

我正在使用 ODBC 的 SQLExecute() 在 MS SQL 2008 上执行 sql。我的代码调用一个存储过程,该过程成为死锁受害者。服务器回滚并且过程终止,但 SQLExecute() 返回成功

服务器跟踪日志清楚地显示了死锁,但 ODBC 跟踪没有任何问题的迹象。由于存在大量并发性,因此会出现死锁,但除非被告知存在问题,否则我的应用程序无法恢复。

ODBC 驱动程序是否应该在此处返回错误?文档指出应该在死锁后设置@@error,但是捕获该信息不是 ODBC 的责任吗?

I'm executing sql on MS SQL 2008 using ODBC's SQLExecute(). My code calls a stored procedure which becomes a deadlock victim. The server rollsback and the procedure is terminated, but SQLExecute() returns success.

The server trace logs clearly show the deadlock, but an ODBC trace has no sign of any problem. The deadlocks are expected since there is a lot of concurrency going on, but my application can't recover unless its told there was a problem.

Should the ODBC driver return an error here? The docs state that @@error should be set after a deadlock, but isn't it ODBC's responsibility to capture that info?

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

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

发布评论

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

评论(1

故乡的云 2024-09-19 17:41:49

啊啊!存储过程中缺少“set nocount on”。缓冲区中没有空间容纳所有备份行更新计数的死锁错误。

Arrrg! Missing "set nocount on" inside a stored procedure. No room in the buffer for the deadlock error with all the backed up row update counts.

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