Concurrency Control for Multiple Position Blocks
The MicroKernel supports using multiple position blocks (cursors) for the same client in the same file.
Inside either a concurrent or an exclusive transaction, multiple position blocks share the same view of modified pages. Each position block in a set of multiple position blocks sees the changes made by the set’s other position blocks immediately, even before those changes are committed.
Multiple position blocks share all locks: explicit and implicit record locks, implicit page locks, and file locks. Consequently, for any client, no one position block’s locks can prevent another position block from obtaining another lock in the same file.
When a client ends or aborts its transaction, the MicroKernel releases all that client’s implicit locks and file locks. However, the MicroKernel releases a client’s explicit record locks only as each position block in a file requires, regardless of whether the lock was granted from within a transaction.
For example, an Unlock operation (27) with -2 as its key value releases only the multiple-record locks belonging to the specified position block. A Close operation (1) releases only those locks obtained for the same position block that is specified when performing the Close operation. Similarly, when a client obtains a position block’s first record, page, or file lock inside a transaction, the MicroKernel releases only those explicit record locks that had been obtained for that position block. In Example 2. (page 9-148), if client 1 had opened the same file three times (instead of file 1, file 2 and file 3), and if client 1 had touched the file using only the first two position blocks, the explicit lock obtained for the third position block would have remained even after the End Transaction operation.