org.apache.derby.impl.store.raw.xact
Class ContainerLocking2

java.lang.Object
  extended by org.apache.derby.impl.store.raw.xact.NoLocking
      extended by org.apache.derby.impl.store.raw.xact.ContainerLocking2
All Implemented Interfaces:
LockingPolicy

public class ContainerLocking2
extends NoLocking

A locking policy that implements container level locking with isolation degree 2.

See Also:
LockingPolicy

Field Summary
private  LockFactory lf
           
 
Fields inherited from interface org.apache.derby.iapi.store.raw.LockingPolicy
MODE_CONTAINER, MODE_NONE, MODE_RECORD
 
Constructor Summary
protected ContainerLocking2()
           
protected ContainerLocking2(LockFactory lf)
           
 
Method Summary
 int getMode()
          Get the mode of this policy
 boolean lockContainer(Transaction t, ContainerHandle container, boolean waitForLock, boolean forUpdate)
          Obtain a Container shared or exclusive lock until the end of the nested transaction.
 void unlockContainer(Transaction t, ContainerHandle container)
          Unlock read locks.
 
Methods inherited from class org.apache.derby.impl.store.raw.xact.NoLocking
lockRecordForRead, lockRecordForWrite, unlockRecordAfterRead, zeroDurationLockRecordForWrite
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

lf

private final LockFactory lf
Constructor Detail

ContainerLocking2

protected ContainerLocking2()

ContainerLocking2

protected ContainerLocking2(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 interface LockingPolicy
Overrides:
lockContainer in class NoLocking
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

unlockContainer

public void unlockContainer(Transaction t,
                            ContainerHandle container)
Unlock read locks.

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

Specified by:
unlockContainer in interface LockingPolicy
Overrides:
unlockContainer in class NoLocking
Parameters:
t - The transaction to associate the lock with.
container - Container to unlock.
See Also:
ContainerHandle, ContainerHandle.close()

getMode

public int getMode()
Description copied from interface: LockingPolicy
Get the mode of this policy

Specified by:
getMode in interface LockingPolicy
Overrides:
getMode in class NoLocking

Built on Thu 2011-03-10 11:54:14+0000, from revision ???

Apache Derby V10.6 Internals - Copyright © 2004,2007 The Apache Software Foundation. All Rights Reserved.