/** * @param tx Transaction. * @param cctx Target cache context. */ public TxTopologyVersionFuture(GridNearTxLocal tx, GridCacheContext cctx) { this.tx = tx; this.cctx = cctx; init(); }
@Override public void apply(IgniteInternalFuture<AffinityTopologyVersion> fut) { try { fut.get(); acquireTopologyVersion(); } catch (IgniteCheckedException e) { onDone(e); } finally { cctx.shared().txContextReset(); } } });
TxTopologyVersionFuture topFut = new TxTopologyVersionFuture(curTx, mvccTracker.context()); topVer = topFut.get(); clientFirst = topFut.clientFirst();
onDone(err); onDone(topVer); acquireTopologyVersion();
new TxTopologyVersionFuture(tx, cctx).get();
TxTopologyVersionFuture topFut = new TxTopologyVersionFuture(curTx, mvccTracker.context()); topVer = topFut.get(); clientFirst = topFut.clientFirst();
/** */ private void init() { // Obtain the topology version to use. long threadId = Thread.currentThread().getId(); AffinityTopologyVersion topVer = cctx.mvcc().lastExplicitLockTopologyVersion(threadId); // If there is another system transaction in progress, use it's topology version to prevent deadlock. if (topVer == null && tx.system()) topVer = cctx.tm().lockedTopologyVersion(threadId, tx); if (topVer != null) tx.topologyVersion(topVer); if (topVer == null) topVer = tx.topologyVersionSnapshot(); if (topVer != null) { for (GridDhtTopologyFuture fut : cctx.shared().exchange().exchangeFutures()) { if (fut.exchangeDone() && fut.topologyVersion().equals(topVer)) { Throwable err = fut.validateCache(cctx, false, false, null, null); if (err != null) { onDone(err); return; } break; } } onDone(topVer); topLocked = true; return; } acquireTopologyVersion(); }
new TxTopologyVersionFuture(tx, cctx).get();
/** * @param tx Transaction. * @param cctx Target cache context. */ public TxTopologyVersionFuture(GridNearTxLocal tx, GridCacheContext cctx) { this.tx = tx; this.cctx = cctx; init(); }
@Override public void apply(IgniteInternalFuture<AffinityTopologyVersion> fut) { try { fut.get(); acquireTopologyVersion(); } catch (IgniteCheckedException e) { onDone(e); } finally { cctx.shared().txContextReset(); } } });