/** Returns (or creates) the instance of the distributed TXLockService */ public static TXLockService createDTLS() { synchronized (TXLockService.class) { if (DTLS == null || DTLS.isDestroyed()) { DTLS = new TXLockServiceImpl(DLockService.DTLS); } return DTLS; } }
@Override public void release(TXLockId txLockId) { synchronized (this.txLockIdList) { if (!this.txLockIdList.contains(txLockId)) { throw new IllegalArgumentException(LocalizedStrings.TXLockServiceImpl_INVALID_TXLOCKID_NOT_FOUND_0.toLocalizedString(txLockId)); } // only release w/ dlock if not in middle of recovery... if (!this.recovering) { this.dlock.releaseTryLocks(txLockId, true); } this.txLockIdList.remove(txLockId); releaseRecoveryReadLock(); } }
if (dtls != null) { dtls.acquireRecoveryWriteLock(); gotRecoveryLock = true; dtls.releaseRecoveryWriteLock();
((TXLockServiceImpl)dtls).getInternalDistributedLockService();
gotLocks = this.dlock.acquireTryLocks(batch, TIMEOUT_MILLIS, LEASE_MILLIS, keyIfFail); if (gotLocks) { // ...otherwise race can occur between tryLocks and readLock acquireRecoveryReadLock();