INF: dbnextrow Does Not Return Fail on Deadlock

Last reviewed: April 29, 1997
Article ID: Q109649

The information in this article applies to:
  • Microsoft SQL Server, version 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


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: April 29, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.