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

public Class RowLocking3Escalate

extends ContainerLocking3
Class Inheritance
Imports
org.apache.derby.iapi.services.locks.LockFactory, org.apache.derby.shared.common.sanity.SanityManager, org.apache.derby.iapi.store.raw.ContainerHandle, .ContainerLock, .RecordHandle, .Transaction, org.apache.derby.shared.common.error.StandardException

A locking policy that implements row level locking with isolation degree 3.
See Also
org.apache.derby.iapi.store.raw.LockingPolicy

Field Summary

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

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
public boolean

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.
lockContainer
(Transaction
Transaction to associate lock with.
t
,
ContainerHandle
Container to lock.
container
,
boolean
Ignored - will never wait for a lock.
waitForLock
,
boolean
Ignored, mode determined from current lock state.
forUpdate
)

Overrides org.apache.derby.impl.store.raw.xact.ContainerLocking3.lockContainer.

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

Escalates Row Locking 3 to Container Locking 3.

Inherited from org.apache.derby.impl.store.raw.xact.ContainerLocking3:
getMode

Constructor Detail

RowLocking3Escalateback to summary
protected RowLocking3Escalate(LockFactory lf)

Method Detail

lockContainerback to summary
public boolean lockContainer(Transaction t, ContainerHandle container, boolean waitForLock, boolean forUpdate) throws StandardException

Overrides org.apache.derby.impl.store.raw.xact.ContainerLocking3.lockContainer.

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

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.

Parameters
t:Transaction

Transaction to associate lock with.

container:ContainerHandle

Container to lock.

waitForLock:boolean

Ignored - will never wait for a lock.

forUpdate:boolean

Ignored, mode determined from current lock state.

Returns:boolean

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.

Exceptions
StandardException:
Standard exception policy.