/** * Destroys this tx lock service and removes the static reference to it. */ public void destroy() { synchronized (TXLockService.class) { if (!isDestroyed()) { basicDestroy(); if (this == DTLS) DTLS = null; } } }
/** * Release any distributed locks obtained by this request */ public void releaseDistributed() { if (this.distLockId != null) { try { TXLockService.createDTLS().release(this.distLockId); } catch (IllegalStateException ignore) { } this.distLockId = null; } }
/** Destroys DTLS in this process to free up resources */ public static void destroyServices() { synchronized (TXLockService.class) { if (DTLS != null) { DTLS.destroy(); DTLS = null; } } }
/** * Intended to be called after TXState.applyChanges when the * potential for a different set of TX members has been determined * and it is safe to ignore any new members because the changes have * been applied to committed state. This was added as the solution * to bug 32999 and the recovery when the TXLock Lessor (the sending * VM) crashes/departs before or while sending the TXCommitMessage. * @see TXState#commit() * @see com.gemstone.gemfire.internal.cache.locks.TXLockBatch#getBatchId() */ private void updateLockMembers() { if (this.lockNeedsUpdate && this.lockId != null) { TXLockService.createDTLS().updateParticipants(this.lockId, this.msgMap.keySet()); } }
public void obtain() throws CommitConflictException { if (this.localLocks != null && !this.localLocks.isEmpty()) { txLocalLock(this.localLocks); this.localLockHeld = true; } if (this.distLocks != null && !this.distLocks.isEmpty()) { this.distLockId = TXLockService.createDTLS().txLock(this.distLocks, this.otherMembers); } } /**
public void handleDepartureOf(InternalDistributedMember owner, DLockGrantor grantor) { TXLockService dtls = TXLockService.getDTLS(); if (dtls == null) return; try { if (!dtls.isLockGrantor()) { logger.debug("This member is not lock grantor; exiting TXLessorDepartureHandler"); return;
@Override protected void process(DistributionManager dm) { this.dm = dm; // Remove this node from the set of recipients if (this.farSiders != null) { this.farSiders.remove(dm.getId()); } if (this.processorId != 0) { TXLockService.createDTLS(); // fix bug 38843; no-op if already created synchronized(this) { // Handle potential origin departure this.dm.addMembershipListener(this); // Assume ACK mode, defer processing until we receive a // CommitProcess message if (logger.isDebugEnabled()) { final Object key = getTrackerKey(); logger.debug("Adding key:{} class{} to tracker list", key, key.getClass().getName()); } txTracker.add(this); } if (!this.dm.getDistributionManagerIds().contains(getSender())) { memberDeparted(getSender(), false /*don't care*/); } } else { basicProcess(); } } /**
/** 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; } }
dtls = (TXLockServiceImpl)TXLockService.getDTLS(); if (dtls != null) {
TXLockService.destroyServices();
TXLockService.createDTLS(); // fix bug 38843; no-op if already created final TXStateProxy txStateProxy = txMgr.getTXState(); boolean precommitSuccess = true;