This example illustrates the use of locking when a single user initiates a transaction.
In this example, a user issues a single query transaction (SQT) consisting of:
Here is the sequence of operations:
The query is restrictive (only the row specified in the where clause is to be retrieved), and the table itself has an ISAM structure indexed on 'name', so the entire table does not have to be scanned. The locking system can use the index to go directly to the row for Jeff. Thus, an S lock on the entire table is not necessary; an IS table-level lock and an S lock on the page containing the row for Jeff are sufficient.
After retrieving the row for Jeff, if the user were to issue an update statement and change that record before issuing the commit, and if there were no other shared locks on the page, the locking system converts the shared page-level lock to an exclusive lock, and the IS lock on the table to an IX lock.