| org.ozoneDB.core.Lock
All known Subclasses: org.ozoneDB.core.AbstractLock,
Lock | public interface Lock extends Serializable(Code) | | Locks are created by the
TransactionManager and used by the core
to manage concurrent access to the same containers/objects. There are several
Lock implementations that provide different policies.
author: SMB version: $Revision: 1.2 $Date: 2002/06/08 00:49:38 $ |
LEVEL_MAX | final public static int LEVEL_MAX(Code) | | |
LEVEL_NONE | final public static int LEVEL_NONE(Code) | | |
LEVEL_READ | final public static int LEVEL_READ(Code) | | |
LEVEL_UPGRADE | final public static int LEVEL_UPGRADE(Code) | | |
LEVEL_WRITE | final public static int LEVEL_WRITE(Code) | | |
NOT_ACQUIRED | final public static int NOT_ACQUIRED(Code) | | |
checkDeadlock | public void checkDeadlock(Transaction ta) throws TransactionError(Code) | | Check for deadlock and throw an exception if a deadlock is detected.
Although the transactions waits for locks and so seems also to be
be a good place for deadlock detection, we do it here because each
Lock implementations should hide the deadlock detection logic.
|
level | public int level(Transaction ta)(Code) | | Returns the lock level for the specified transaction. If ta is null,
then we do not check ta against the transaction that has acquired this
lock.
Parameters: ta - The transaction that has acquired the lock or null. Lock level for ta if ta has aquired the lock or ta is null. LEVEL_NONEotherwise. |
lockerIDs | public DxCollection lockerIDs()(Code) | | Return all transactions that currently hold this lock.
|
release | public void release(Transaction ta)(Code) | | Release the previously aquired lock.
|
reset | public void reset()(Code) | | |
tryAcquire | public int tryAcquire(Transaction ta, int level)(Code) | | Try to aquire this lock. This method returns the previous level of the
specified transaction, if the lock was sucessfully acquired. Otherwise
it returns NOT_ACQUIRED.
The previous level for the given transaction or NOT_ACQUIRED. |
|
|