LockingPolicy
public class RowLocking1 extends RowLocking2
LockingPolicy
MODE_CONTAINER, MODE_NONE, MODE_RECORD
lf
Modifier | Constructor | Description |
---|---|---|
protected |
RowLocking1(LockFactory lf) |
Modifier and Type | Method | Description |
---|---|---|
boolean |
lockRecordForRead(Transaction t,
ContainerHandle container_handle,
RecordHandle record,
boolean waitForLock,
boolean forUpdate) |
Obtain lock on record being read.
|
void |
unlockRecordAfterRead(Transaction t,
ContainerHandle container_handle,
RecordHandle record,
boolean forUpdate,
boolean row_qualified) |
Unlock a record after it has been locked for read.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
lockContainer, unlockContainer
getMode, lockRecordForWrite, zeroDurationLockRecordForWrite
getReadLockType, getUpdateLockType, getWriteLockType
protected RowLocking1(LockFactory lf)
public boolean lockRecordForRead(Transaction t, ContainerHandle container_handle, RecordHandle record, boolean waitForLock, boolean forUpdate) throws StandardException
Assumes that a table level IS has been acquired. Will acquire a Shared or Update lock on the row, depending on the "forUpdate" parameter.
Read lock will be placed on separate group from transaction.
lockRecordForRead
in interface LockingPolicy
lockRecordForRead
in class RowLocking2
t
- The transaction to associate the lock with.record
- The record to be locked.waitForLock
- Should lock request wait until granted?forUpdate
- Whether to open for read or write access.container_handle
- Open Container used to get record. Will be used
to row locks by the container they belong to.StandardException
- Standard exception policy.Page
public void unlockRecordAfterRead(Transaction t, ContainerHandle container_handle, RecordHandle record, boolean forUpdate, boolean row_qualified) throws StandardException
RowLockingRR
In repeatable read only unlock records which "did not qualify". For example in a query like "select * from foo where a = 1" on a table with no index it is only necessary to hold locks on rows where a=1, but in the process of finding those rows the system will get locks on other rows to verify they are committed before applying the qualifier. Those locks can be released under repeatable read isolation.
unlockRecordAfterRead
in interface LockingPolicy
unlockRecordAfterRead
in class RowLocking2
StandardException
- Standard exception policy.Page
Apache Derby V10.14 Internals - Copyright © 2004,2018 The Apache Software Foundation. All Rights Reserved.