|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--arlut.csd.ganymede.DBLock
|
+--arlut.csd.ganymede.DBWriteLock
A DBWriteLock is a DBLock subclass
used to lock one or more
DBObjectBases for the purposes
of committing changes into those bases, preventing any
other threads from reading or writing to the database while the update
is being performed. When a DBWriteLock
is established on a DBObjectBase, the establishing thread suspends until
all readers currently working in the specified DBObjectBases complete. The
write lock is then established, and the thread possessing the DBWriteLock
is free to replace objects in the DBStore
with modified copies.
DBWriteLocks are typically created and managed by the code in the
DBEditSet
class. It is very important that any thread that obtains a DBWriteLock be
scrupulous about releasing the lock in a timely fashion once the
appropriate changes are made in the database.
DBEditSet,
DBObjectBase| Field Summary | |
(package private) static boolean |
debug
|
| Fields inherited from class arlut.csd.ganymede.DBLock |
abort, baseSet, inEstablish, key, locked, lockSync |
| Constructor Summary | |
DBWriteLock(arlut.csd.ganymede.DBStore store)
constructor to get a write lock on all the object bases |
|
DBWriteLock(arlut.csd.ganymede.DBStore store,
java.util.Vector baseSet)
constructor to get a write lock on a subset of the object bases. |
|
| Method Summary | |
void |
abort()
Withdraw this lock. |
void |
establish(java.lang.Object key)
Establish a dump lock on bases specified in this DBWriteLock's constructor. |
void |
release()
Release this lock on all bases locked |
| Methods inherited from class arlut.csd.ganymede.DBLock |
getKey, isLocked, isLocked, isLocked, overlaps, toString |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
static final boolean debug
| Constructor Detail |
public DBWriteLock(arlut.csd.ganymede.DBStore store)
public DBWriteLock(arlut.csd.ganymede.DBStore store,
java.util.Vector baseSet)
| Method Detail |
public void establish(java.lang.Object key)
throws java.lang.InterruptedException
Establish a dump lock on bases specified in this DBWriteLock's constructor. Can throw InterruptedException if another thread orders us to abort() while we're waiting for permission to proceed with writes on the specified baseset.
establish in class DBLockjava.lang.InterruptedExceptionpublic void release()
release in class DBLockpublic void abort()
Withdraw this lock. This method can be called by a thread to
interrupt a lock establish that is blocked waiting to get
access to the appropriate set of
DBObjectBase objects. If
this method is called while another thread is blocked in
establish(), establish() will throw an InterruptedException.
Once abort() is processed, this lock may never be established. Any subsequent calls to estabish() will always throw InterruptedException.
abort in class DBLock
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||