Class ContainerLocking2
java.lang.Object
org.apache.derby.impl.store.raw.xact.NoLocking
org.apache.derby.impl.store.raw.xact.ContainerLocking2
- All Implemented Interfaces:
LockingPolicy
A locking policy that implements container level locking with
isolation degree 2.
- See Also:
-
Field Summary
FieldsFields inherited from interface LockingPolicy
MODE_CONTAINER, MODE_NONE, MODE_RECORD -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedprotected -
Method Summary
Modifier and TypeMethodDescriptionintgetMode()Get the mode of this policybooleanlockContainer(Transaction t, ContainerHandle container, boolean waitForLock, boolean forUpdate) Obtain a Container shared or exclusive lock until the end of the nested transaction.voidunlockContainer(Transaction t, ContainerHandle container) Unlock read locks.Methods inherited from class NoLocking
lockRecordForRead, lockRecordForWrite, unlockRecordAfterRead, zeroDurationLockRecordForWrite
-
Field Details
-
lf
-
-
Constructor Details
-
ContainerLocking2
protected ContainerLocking2() -
ContainerLocking2
-
-
Method Details
-
lockContainer
public boolean lockContainer(Transaction t, ContainerHandle container, boolean waitForLock, boolean forUpdate) throws StandardException Obtain a Container shared or exclusive lock until the end of the nested transaction.- Specified by:
lockContainerin interfaceLockingPolicy- Overrides:
lockContainerin classNoLocking- Parameters:
t- Transaction to associate lock with.container- Container to lock.waitForLock- Should lock request wait until granted?forUpdate- Should container be locked for update, or read?- 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 Derby error policy- See Also:
-
unlockContainer
Unlock read locks.In Cursor stability release all read locks obtained. unlockContainer() will be called when the container is closed.
- Specified by:
unlockContainerin interfaceLockingPolicy- Overrides:
unlockContainerin classNoLocking- Parameters:
t- The transaction to associate the lock with.container- Container to unlock.- See Also:
-
getMode
public int getMode()Description copied from interface:LockingPolicyGet the mode of this policy- Specified by:
getModein interfaceLockingPolicy- Overrides:
getModein classNoLocking
-