Top Description Fields Constructors Methods
org.apache.derby.impl.store.raw.xact

public Class RowLockingRR

extends RowLocking3
Class Inheritance
Known Direct Subclasses
org.apache.derby.impl.store.raw.xact.RowLocking2
Imports
org.apache.derby.iapi.services.locks.LockFactory, org.apache.derby.shared.common.sanity.SanityManager, org.apache.derby.iapi.store.raw.ContainerHandle, .ContainerLock, .LockingPolicy, .RecordHandle, .RowLock, .Transaction, org.apache.derby.shared.common.error.StandardException

A locking policy that implements row level locking with repeatable read isolation. Since phantom protection with previous key locking is actually handled by the upper level access methods, the only difference in repeatable read is that read locks are of type RowLock.RS2. This type will not conflict with a previous key insert lock.
See Also
org.apache.derby.iapi.store.raw.LockingPolicy

Field Summary

Inherited from org.apache.derby.impl.store.raw.xact.RowLocking3:
lf

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
protected RowLock
getReadLockType()

Overrides org.apache.derby.impl.store.raw.xact.RowLocking3.getReadLockType.

Get type of lock to get while reading data.

protected RowLock
getUpdateLockType()

Overrides org.apache.derby.impl.store.raw.xact.RowLocking3.getUpdateLockType.

Get type of lock to get while requesting "update" lock.

protected RowLock
getWriteLockType()

Overrides org.apache.derby.impl.store.raw.xact.RowLocking3.getWriteLockType.

Get type of lock to get while writing data.

public void
unlockRecordAfterRead(Transaction t, ContainerHandle container_handle, RecordHandle record, boolean forUpdate, boolean row_qualified)

Overrides org.apache.derby.impl.store.raw.xact.NoLocking.unlockRecordAfterRead.

Implements org.apache.derby.iapi.store.raw.LockingPolicy.unlockRecordAfterRead.

Unlock a record after it has been locked for read.

Inherited from org.apache.derby.impl.store.raw.xact.RowLocking3:
getModelockContainerlockRecordForReadlockRecordForWritezeroDurationLockRecordForWrite

Constructor Detail

RowLockingRRback to summary
protected RowLockingRR(LockFactory lf)

Method Detail

getReadLockTypeback to summary
protected RowLock getReadLockType()

Overrides org.apache.derby.impl.store.raw.xact.RowLocking3.getReadLockType.

Doc from org.apache.derby.impl.store.raw.xact.RowLocking3.getReadLockType.

Get type of lock to get while reading data.

This routine is provided so that class's like RowLockingRR can override just this routine to get RS2 locks vs RS3 locks, and still reuse all the other code in this class.

Returns:RowLock

The lock type of a shared lock for this locking policy.

getUpdateLockTypeback to summary
protected RowLock getUpdateLockType()

Overrides org.apache.derby.impl.store.raw.xact.RowLocking3.getUpdateLockType.

Doc from org.apache.derby.impl.store.raw.xact.RowLocking3.getUpdateLockType.

Get type of lock to get while requesting "update" lock.

This routine is provided so that class's like RowLockingRR can override just this routine to get RU2 locks vs RU3 locks, and still reuse all the other code in this class.

Returns:RowLock

The lock type of a shared lock for this locking policy.

getWriteLockTypeback to summary
protected RowLock getWriteLockType()

Overrides org.apache.derby.impl.store.raw.xact.RowLocking3.getWriteLockType.

Doc from org.apache.derby.impl.store.raw.xact.RowLocking3.getWriteLockType.

Get type of lock to get while writing data.

This routine is provided so that class's like RowLockingRR can override just this routine to get RX2 locks vs RX3 locks, and still reuse all the other code in this class.

Returns:RowLock

The lock type of a shared lock for this locking policy.

unlockRecordAfterReadback to summary
public void unlockRecordAfterRead(Transaction t, ContainerHandle container_handle, RecordHandle record, boolean forUpdate, boolean row_qualified) throws StandardException

Overrides org.apache.derby.impl.store.raw.xact.NoLocking.unlockRecordAfterRead.

Implements org.apache.derby.iapi.store.raw.LockingPolicy.unlockRecordAfterRead.

Unlock a record after it has been locked for read.

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.

Exceptions
StandardException:
Standard exception policy.