INF: dbnextrow Does Not Return Fail on Deadlock

ID: Q109649


The information in this article applies to:
  • Microsoft SQL Server version 4.2x


BUG# NT: 9739 (4.2) 

SUMMARY

If a process running dbnextrow() is chosen as the victim of a deadlock resolution (SQL Server error 1205) the call to dbnextrow() will return NO_MORE_ROWS.

The SQL Server message handler will be invoked with the correct message number (1205). The DB-Library (DB-Lib) error handler will not be invoked.

The following is the SQL Server error 1205:

Your server command (process id #%d) was deadlocked with another process and has been chosen as deadlock victim. Re-run your command.


MORE INFORMATION

This is the expected behavior of DB-Library. To handle the condition, check for error 1205 in the message handler, and use the dbsetuserdata function to communicate this to your application. An example can be found in Chapter 4 on DB-Library functions in the SQL Server "Programmers Reference for C" under dbsetuserdata.

Additionally, you can find an example of how to detect a deadlock condition in "Appendix E Maximizing Consistency and Concurrency" in the SQL Server for Windows NT "Programmer's Reference for C" or in the "Maximizing Database Consistency and Concurrency" Manual for SQL Server for OS/2 version 4.2b.

Additional query words: Windows NT

Keywords : kbprg SSrvWinNT
Version : 4.2
Platform : WINDOWS
Issue type :


Last Reviewed: March 18, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.