Previous Topic: Mixing Isolation LevelsNext Topic: CICS Unit of Recovery End


Locking a Row

If your application needs to hold a lock on a row, you must specify ISOLEVEL=C and use the SQL FETCH statement to fetch the row using a cursor that has a WHERE CURRENT OF cursor-name clause in either an UPDATE or DELETE statement (the WHERE CURRENT OF cursor-name clause need never be executed but, if none are present, blocked transfer of rows may either cause the share lock acquired for FETCHed rows to be released before your application fetches them, or a temporary table may be built). The WHERE CURRENT OF cursor-name clause causes the row on which your application is positioned to be held with an exclusive lock.

Note: Using the SQL SELECT INTO statement with ISOLEVEL=C causes rows to be accessed by a share lock, but the lock is released before control is passed to your application.