/** * Resumes transaction (possibly in another thread) if it was previously suspended. * * @throws IgniteCheckedException If the transaction is in an incorrect state, or timed out. */ public void resume() throws IgniteCheckedException { resume(true, Thread.currentThread().getId()); }
/** * Resume transaction if it was previously suspended. * * @param tx Transaction to resume. * @throws IgniteCheckedException If resume failed. */ public void resumeTx(GridNearTxLocal tx) throws IgniteCheckedException { tx.txState().awaitLastFuture(this); tx.resume(); }
/** {@inheritDoc} */ @Override public void start(Xid xid, int flags) throws XAException { if (log.isDebugEnabled()) log.debug("XA resource start(...) [xid=" + xid + ", flags=<" + flags(flags) + ">]"); // Simply save global transaction id. this.xid = xid; if ((flags & TMRESUME) == TMRESUME) { try { cacheTx.resume(); } catch (IgniteCheckedException e) { throwException("Failed to resume cache transaction: " + e.getMessage(), e); } } }
/** {@inheritDoc} */ @Override public void onTimeout() { if (state() == SUSPENDED) { try { resume(false, threadId()); } catch (IgniteCheckedException e) { log.warning("Error resuming suspended transaction on timeout: " + this, e); } } boolean proceed; synchronized (this) { proceed = state() != PREPARED && state(MARKED_ROLLBACK, true); } if (proceed || (state() == MARKED_ROLLBACK)) { cctx.kernalContext().closure().runLocalSafe(new Runnable() { @Override public void run() { // Note: if rollback asynchronously on timeout should not clear thread map // since thread started tx still should be able to see this tx. rollbackNearTxLocalAsync(false, true); U.warn(log, "The transaction was forcibly rolled back because a timeout is reached: " + CU.txString(GridNearTxLocal.this)); } }); } else { if (log.isDebugEnabled()) log.debug("Skip rollback tx on timeout: " + this); } }
/** * Resumes transaction (possibly in another thread) if it was previously suspended. * * @throws IgniteCheckedException If the transaction is in an incorrect state, or timed out. */ public void resume() throws IgniteCheckedException { resume(true, Thread.currentThread().getId()); }
/** * Resume transaction if it was previously suspended. * * @param tx Transaction to resume. * @throws IgniteCheckedException If resume failed. */ public void resumeTx(GridNearTxLocal tx) throws IgniteCheckedException { tx.txState().awaitLastFuture(this); tx.resume(); }
/** {@inheritDoc} */ @Override public void start(Xid xid, int flags) throws XAException { if (log.isDebugEnabled()) log.debug("XA resource start(...) [xid=" + xid + ", flags=<" + flags(flags) + ">]"); // Simply save global transaction id. this.xid = xid; if ((flags & TMRESUME) == TMRESUME) { try { cacheTx.resume(); } catch (IgniteCheckedException e) { throwException("Failed to resume cache transaction: " + e.getMessage(), e); } } }
/** {@inheritDoc} */ @Override public void onTimeout() { if (state() == SUSPENDED) { try { resume(false, threadId()); } catch (IgniteCheckedException e) { log.warning("Error resuming suspended transaction on timeout: " + this, e); } } boolean proceed; synchronized (this) { proceed = state() != PREPARED && state(MARKED_ROLLBACK, true); } if (proceed || (state() == MARKED_ROLLBACK)) { cctx.kernalContext().closure().runLocalSafe(new Runnable() { @Override public void run() { // Note: if rollback asynchronously on timeout should not clear thread map // since thread started tx still should be able to see this tx. rollbackNearTxLocalAsync(false, true); U.warn(log, "The transaction was forcibly rolled back because a timeout is reached: " + CU.txString(GridNearTxLocal.this)); } }); } else { if (log.isDebugEnabled()) log.debug("Skip rollback tx on timeout: " + this); } }