First page Back Continue Last page Graphics
Row Lock Architecture
Row locks are created as entry in data block
- No memory limit on locks
- But, transaction will wait if:
- No space in block
- Row already locked
See INITTRANS, MAXTRANS parameters
- Controls (limits) block space used for locks
Lock manager is not required
Notes:
Oracle implements row locks by creating an entry in the block that contains the row. (Note that some other database systems implement locks by creating a memory-based list of locked blocks or rows. This technique requires a lock manager process, which is not required in the Oracle architecture.)
When a transaction attempts to update a row, Oracle checks the data block to determine if a lock already exists. If the row is already locked by another transaction, then blocking (waiting) occurs until the other transaction commits or rolls back, which frees the existing lock.
Another consideration is the space required to create the lock. Though only a reasonably few bytes, space in a data block header is limited. The CREATE TABLE INITRANS parameter reserves space for row locks. If free space exists in the block, this space can grow until the MAXTRANS specification is reached. If no space is available, or the MAXTRANS limit has already been reached, the transaction will wait until other transactions commit or rollback, freeing space in the block by releasing locks.