SLIDE 25 Cursor locking
- Cursors are used to traverse tables
- They can also be used (and are used) as a
way to implement concurrency control.
- Get a cursor on a table
- As the cursor advances, the corresponding
locks are obtained on the next tuple and released on the previous
- Cursors cannot get ahead of each other
- Useful for select statements scanning a
table and using a complex predicate to decide what to update
Transactions - 2PL 25
EXEC SQL declare new_curs cursor for select * from customer_notansi for update;
https://www.ibm.com/support/knowledgecenter /en/SSGU8G_12.1.0/com.ibm.sqls.doc/ids_sqs_0 660.htm