Progress
Version 9
Product Update Bulletin


READPAST Record Lock

The READPAST locking hint skips locked rows during the execution of a SELECT statement. This option causes a transaction to skip rows locked by other transactions that would ordinarily appear in the result set, rather than block the transaction waiting for the other transactions to release their locks on those rows. The READPAST lock hint applies only to transactions operating at READ COMMITTED isolation level and will read only past row-level locks. This only applies to the SELECT statement.

The locking hint clause such as for READPAST can only be specified in the main SELECT statement, but not in the sub-query SELECT statement in the search condition of the WHERE clause.

The SELECT statement uses the following syntax:

Syntax

SELECT column_list 
  FROM table_list 
    [ WHERE search_condition ] 
    [ GROUP BY grouping_condition ] 
    [ HAVING search_condition ] 
    [ ORDER BY ordering_condition ] 
    [ WITH locking_hints ] 
    [ FOR UPDATE update_condition ] 
; 

The WITH phrase uses the following syntax:

Syntax
WITH ( READPAST [ NOWAIT ][ WAIT timeout ] ) 

EXAMPLES

The following example illustrates the use of the READPAST locking hint with NOWAIT specified:

SELECT * FROM Customer WHERE “CustNum” < 100 ORDER BY “CustNum” FOR 
UPDATE 
WITH (READPAST NOWAIT); 

The following example illustrates the use of the READPAST locking hint with WAIT time-out specified:

SELECT * FROM Customer WHERE “CustNum” < 100 ORDER BY “CustNum” FOR 
UPDATE 
WITH (READPAST WAIT 1); 


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095