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

public Class ContainerLocking2

extends NoLocking
Class Inheritance
Imports
org.apache.derby.iapi.services.locks.LockFactory, .C_LockFactory, org.apache.derby.iapi.store.raw.ContainerHandle, .ContainerLock, .Transaction, org.apache.derby.shared.common.error.StandardException

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

Field Summary

Modifier and TypeField and Description
private final LockFactory

Constructor Summary

AccessConstructor and Description
protected
protected

Method Summary

Modifier and TypeMethod and Description
public int
public boolean
lockContainer(Transaction
Transaction to associate lock with.
t
,
ContainerHandle
Container to lock.
container
,
boolean
Should lock request wait until granted?
waitForLock
,
boolean
Should container be locked for update, or read?
forUpdate
)

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

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

Obtain a Container shared or exclusive lock until the end of the nested transaction.

public void
unlockContainer(Transaction
The transaction to associate the lock with.
t
,
ContainerHandle
Container to unlock.
container
)

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

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

Unlock read locks.

Inherited from org.apache.derby.impl.store.raw.xact.NoLocking:
lockRecordForReadlockRecordForWriteunlockRecordAfterReadzeroDurationLockRecordForWrite

Field Detail

lfback to summary
private final LockFactory lf

Constructor Detail

ContainerLocking2back to summary
protected ContainerLocking2()
ContainerLocking2back to summary
protected ContainerLocking2(LockFactory lf)

Method Detail

getModeback to summary
public int getMode()

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

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

Doc from org.apache.derby.iapi.store.raw.LockingPolicy.getMode.

Get the mode of this policy

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

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

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

Obtain a Container shared or exclusive lock until the end of the nested transaction.

Parameters
t:Transaction

Doc from org.apache.derby.iapi.store.raw.LockingPolicy.lockContainer.

Transaction to associate lock with.

container:ContainerHandle

Doc from org.apache.derby.iapi.store.raw.LockingPolicy.lockContainer.

Container to lock.

waitForLock:boolean

Doc from org.apache.derby.iapi.store.raw.LockingPolicy.lockContainer.

Should lock request wait until granted?

forUpdate:boolean

Doc from org.apache.derby.iapi.store.raw.LockingPolicy.lockContainer.

Should container be locked for update, or read?

Returns:boolean

Doc from org.apache.derby.iapi.store.raw.LockingPolicy.lockContainer.

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 Derby error policy
unlockContainerback to summary
public void unlockContainer(Transaction t, ContainerHandle container)

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

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

Unlock read locks.

In Cursor stability release all read locks obtained. unlockContainer() will be called when the container is closed.

Parameters
t:Transaction

The transaction to associate the lock with.

container:ContainerHandle

Container to unlock.