public class RowLocking1 extends RowLocking2
LockingPolicylfMODE_CONTAINER, MODE_NONE, MODE_RECORD| Modifier | Constructor and Description |
|---|---|
protected |
RowLocking1(LockFactory lf) |
| Modifier and Type | Method and 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.
|
lockContainer, unlockContainergetReadLockType, getUpdateLockType, getWriteLockTypegetMode, lockRecordForWrite, zeroDurationLockRecordForWriteprotected 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 LockingPolicylockRecordForRead in class RowLocking2t - 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.Pagepublic void unlockRecordAfterRead(Transaction t, ContainerHandle container_handle, RecordHandle record, boolean forUpdate, boolean row_qualified) throws StandardException
RowLockingRRIn 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 LockingPolicyunlockRecordAfterRead in class RowLocking2StandardException - Standard exception policy.PageApache Derby V10.10 Internals - Copyright © 2004,2014 The Apache Software Foundation. All Rights Reserved.