INF: Using Separate Connections for Update in Browse Mode

Last reviewed: April 25, 1997
Article ID: Q45253

The information in this article applies to:

  - Microsoft SQL Server version 4.2 for OS/2
  - Microsoft SQL Server version 4.2

SUMMARY

This article explains locking when using separate connections for an update in browse mode.

MORE INFORMATION

SQL Server considers different connections to be different users. This means that the select connection could block (or deadlock) the update connection. The select statement acquires a shared page lock on each page that it reads. If HOLDLOCK is not used, it releases each shared page lock as soon as it finishes reading the page. Whenever there are unprocessed rows from a select statement, the page containing the first unprocessed row remains locked until all rows from that page are processed. Then, the lock is moved to the next page. Unfortunately, the page containing the first unprocessed row probably will also contain the row that is to be updated.

If HOLDLOCK is used, the shared locks are held until commit, and a second connection cannot be used to update any rows read by the first connection.

Note that browse mode creates a temporary table of result data so that there are no locks left on the underlying table. As a result, the two connections will have no lock contention. Browse mode uses a timestamp column to control data integrity problems that might result from concurrent updates.


Additional query words: Windows NT
Keywords : kbother SSrvServer SSrvWinNT
Version : 4.2 | 4.2
Platform : OS/2 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 25, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.