Class RowLocking3Escalate
java.lang.Object
org.apache.derby.impl.store.raw.xact.NoLocking
org.apache.derby.impl.store.raw.xact.ContainerLocking3
org.apache.derby.impl.store.raw.xact.RowLocking3Escalate
- All Implemented Interfaces:
LockingPolicy
A locking policy that implements row level locking with isolation degree 3.
- See Also:
-
Field Summary
Fields inherited from class ContainerLocking3
lfFields inherited from interface LockingPolicy
MODE_CONTAINER, MODE_NONE, MODE_RECORD -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanlockContainer(Transaction t, ContainerHandle container, boolean waitForLock, boolean forUpdate) Escalates Row Locking 3 to Container Locking 3.Methods inherited from class ContainerLocking3
getModeMethods inherited from class NoLocking
lockRecordForRead, lockRecordForWrite, unlockContainer, unlockRecordAfterRead, zeroDurationLockRecordForWrite
-
Constructor Details
-
RowLocking3Escalate
-
-
Method Details
-
lockContainer
public boolean lockContainer(Transaction t, ContainerHandle container, boolean waitForLock, boolean forUpdate) throws StandardException Escalates Row Locking 3 to Container Locking 3.This call is made by code which tracks the number of locks on a container. When the number of locks exceeds the escalate threshold the caller creates this new locking policy, calls lockContainer(), and substitues it for the old locking policy. The lockContainer call determines which table lock to get (S or X), gets that table lock, and then releases the row locks on the table. It is assumed that this is called on a open container for lock only.
- Specified by:
lockContainerin interfaceLockingPolicy- Overrides:
lockContainerin classContainerLocking3- Parameters:
t- Transaction to associate lock with.container- Container to lock.waitForLock- Ignored - will never wait for a lock.forUpdate- Ignored, mode determined from current lock state.- Returns:
- true if the lock was obtained, false if it wasn't. False should only be returned if the waitForLock policy was set to "false," and the lock was unavailable.
- Throws:
StandardException- Standard exception policy.- See Also:
-