Sybase Technical Library - Product Manuals Home
[Search Forms] [Previous Section with Hits] [Next Section with Hits] [Clear Search] Expand Search

Allpages-locked tables and readpast queries [Table of Contents] Data modification commands with readpast and
isolation levels

Transact-SQL User's Guide

[-] Chapter 19 Locking Commands and Options
[-] Readpast locking for queue processing
[-] Effects of isolation levels select queries with readpast

Effects of isolation levels select queries with readpast

Readpast locking is designed to be used at transaction isolation level 1 or 2.

Session-level transaction isolation levels and readpast

For data-only-locked tables, the effects of readpast on a table in a select command are shown in Table 19-1.

Session-level isolation level and the use of readpast

Session Isolation Level

Effects

0, read uncommitted (dirty reads)

readpast is ignored, and rows containing uncommitted transactions are returned to the user. A warning message is printed.

1, read committed

Rows or pages with incompatible locks are skipped; no locks are held on the rows or pages read.

2, repeatable read

Rows or pages with incompatible locks skipped; shared locks are held on all rows or pages that are read until the end of the statement or transaction.

3, serializable

readpast is ignored, and the command executes at level 3. The command blocks on any rows or pages with incompatible locks.

Query-level isolation levels and readpast

If select commands that specify readpast also include any of the following clauses, the commands fail and display error messages:

If a select query that specifies readpast also specifies at isolation 2 or at isolation repeatable read, shared locks are held on the readpast table or tables until the statement or transaction completes.

readtext commands that include readpast and that specify at isolation read uncommitted automatically run at isolation level 0 after issuing a warning message.


Allpages-locked tables and readpast queries [Table of Contents] Data modification commands with readpast and
isolation levels