|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--ojb.odmg.locking.LockManagerDefaultImpl
The OJB default implementation of a Locking mechanism. This Implementation supports 4 transaction isolation levels as specified in the interface ojb.broker.metadata.IsolationLevels: public final int RW_READ_UNCOMMITTED = 0; public final int RW_READ_COMMITTED = 1; public final int RW_REPEATABLE_READ = 2; public final int RW_SERIALIZABLE = 3; Isolationlevels can be adjusted per class. The proper lockhandling is done in the respective LockStrategy implementation. This default implementation provides persistent Locks that are stored in a special database table. To keep the locks in the database and not in memory allows to use them accross multiple distributed ODMG clients. Of course this solution causes a lot of database reads and writes even if no real application data is written to the database. This solution may thus not be suited for all environments. As the LockManager is pluggable its possible to replace the default implementation by user defined implementations. A different solution might be to implement the LockManager as an additional standalone server, that allows to elminate additional db reads and writes.
Constructor Summary | |
(package private) |
LockManagerDefaultImpl()
LockManagerDefaultImpl constructor comment. |
Method Summary | |
boolean |
checkRead(TransactionImpl tx,
java.lang.Object obj)
checks if there is a readlock for transaction tx on object obj. |
boolean |
checkWrite(TransactionImpl tx,
java.lang.Object obj)
checks if there is a writelock for transaction tx on object obj. |
boolean |
readLock(TransactionImpl tx,
java.lang.Object obj)
aquires a readlock for transaction tx on object obj. |
boolean |
releaseLock(TransactionImpl tx,
java.lang.Object obj)
releases a lock for transaction tx on object obj. |
boolean |
upgradeLock(TransactionImpl tx,
java.lang.Object obj)
upgrades readlock for transaction tx on object obj to a writelock. |
boolean |
writeLock(TransactionImpl tx,
java.lang.Object obj)
aquires a writelock for transaction tx on object obj. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
LockManagerDefaultImpl()
Method Detail |
public boolean readLock(TransactionImpl tx, java.lang.Object obj)
readLock
in interface LockManager
public boolean writeLock(TransactionImpl tx, java.lang.Object obj)
writeLock
in interface LockManager
public boolean upgradeLock(TransactionImpl tx, java.lang.Object obj)
upgradeLock
in interface LockManager
public boolean releaseLock(TransactionImpl tx, java.lang.Object obj)
releaseLock
in interface LockManager
public boolean checkRead(TransactionImpl tx, java.lang.Object obj)
checkRead
in interface LockManager
public boolean checkWrite(TransactionImpl tx, java.lang.Object obj)
checkWrite
in interface LockManager
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |