@exception StandardException Standard Cloudscape policy.
*/
public void setExclusive(BaseContainerHandle requester)
throws StandardException {
RawTransaction t = requester.getTransaction();
// In some cases latches are held until after a commit or an abort
// (currently internal and nested top transactions.
// If this is the case then during an abort a latch
// request will be made for a latch that is already held.
// We do not allow the latch to be obtained multiple times
// because i) lock manager might assume latches are exclusive for
// performance, ii) holding a page latched means that the page is
// on the container handle's obervers list, if we latched it twice
// then the paeg would have to be on the list twice, which is not supported
// since the page has value equality. To be on the list twice reference
// equality would be required, which would mean pushing a ReferenceObservable
// object for every latch; iii) other unknown reasons :-)
synchronized (this)
{
// need synchronized block because owner may be set to null in the
// middle if another thread is in the process of unlatching the
// page
if ((owner != null) && (t == owner.getTransaction())) {
if (t.inAbort()) {
//
nestedLatch++;
return;
}
}
// just deadlock out ...
}
// Latch the page, owner is set through the Lockable call backs.
t.getLockFactory().latchObject(
t, this, requester, C_LockFactory.WAIT_FOREVER);
// latch granted, but cleaner may "own" the page.
if (SanityManager.DEBUG) {