use of org.apache.derby.iapi.services.locks.CompatibilitySpace in project derby by apache.
the class CacheLock method lockProperties.
/**
* Lock the database properties for an update.
*/
void lockProperties(TransactionController tc) throws StandardException {
// lock the property set until the transaction commits.
// This allows correct operation of the cache. The cache remains
// valid for all transactions except the one that is modifying
// it. Thus readers see the old uncommited values. When this
// thread releases its exclusive lock the cached is cleared
// and the next reader will re-populate the cache.
CompatibilitySpace cs = tc.getLockSpace();
Object csGroup = cs.getOwner();
lf.lockObject(cs, csGroup, cachedLock, ShExQual.EX, C_LockFactory.TIMED_WAIT);
}
use of org.apache.derby.iapi.services.locks.CompatibilitySpace in project derby by apache.
the class CacheLock method iHoldTheUpdateLock.
/**
* Return true if the caller holds the exclusive update lock on the
* property conglomerate.
*/
private boolean iHoldTheUpdateLock(TransactionController tc) throws StandardException {
CompatibilitySpace cs = tc.getLockSpace();
Object csGroup = cs.getOwner();
return lf.isLockHeld(cs, csGroup, cachedLock, ShExQual.EX);
}
Aggregations