Class ContainerLocking3
- java.lang.Object
-
- org.apache.derby.impl.store.raw.xact.NoLocking
-
- org.apache.derby.impl.store.raw.xact.ContainerLocking3
-
- All Implemented Interfaces:
LockingPolicy
- Direct Known Subclasses:
RowLocking3Escalate
public class ContainerLocking3 extends NoLocking
A locking policy that implements container level locking with isolation degree 3.- See Also:
LockingPolicy
-
-
Field Summary
Fields Modifier and Type Field Description protected LockFactory
lf
-
Fields inherited from interface org.apache.derby.iapi.store.raw.LockingPolicy
MODE_CONTAINER, MODE_NONE, MODE_RECORD
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
ContainerLocking3(LockFactory lf)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getMode()
Get the mode of this policyboolean
lockContainer(Transaction t, ContainerHandle container, boolean waitForLock, boolean forUpdate)
Obtain a Container shared or exclusive lock until the end of the nested transaction.-
Methods inherited from class org.apache.derby.impl.store.raw.xact.NoLocking
lockRecordForRead, lockRecordForWrite, unlockContainer, unlockRecordAfterRead, zeroDurationLockRecordForWrite
-
-
-
-
Field Detail
-
lf
protected final LockFactory lf
-
-
Constructor Detail
-
ContainerLocking3
protected ContainerLocking3(LockFactory lf)
-
-
Method Detail
-
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:
lockContainer
in interfaceLockingPolicy
- Overrides:
lockContainer
in 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:
ContainerHandle
-
getMode
public int getMode()
Description copied from interface:LockingPolicy
Get the mode of this policy- Specified by:
getMode
in interfaceLockingPolicy
- Overrides:
getMode
in classNoLocking
-
-