发生死锁时 ODBC 会发生什么情况?
我正在使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
啊啊!存储过程中缺少“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.