private int abortTxns(Connection dbConn, List<Long> txnids, boolean isStrict) throws SQLException { return abortTxns(dbConn, txnids, -1, isStrict); } /**
int numTxnsAborted = 0; for(List<Long> batchToAbort : timedOutTxns) { if(abortTxns(dbConn, batchToAbort, now - timeout, true) == batchToAbort.size()) { dbConn.commit(); numTxnsAborted += batchToAbort.size();
"] has already updated resource '" + resourceName + "'"; LOG.info(msg); if(abortTxns(dbConn, Collections.singletonList(writeSet.get(0).txnId), true) != 1) { throw new IllegalStateException(msg + " FAILED!");
if (abortTxns(dbConn, Collections.singletonList(txnid), true) != 1) { TxnStatus status = findTxnState(txnid,stmt); if(status == TxnStatus.ABORTED) {
int numAborts = abortTxns(dbConn, txnIds, true); assert(numAborts == numAbortedWrites);
LOG.info(msg); if (abortTxns(dbConn, Collections.singletonList(txnid), true) != 1) { throw new IllegalStateException(msg + " FAILED!");
if (deadTxns.size() > 0) abortTxns(dbConn, deadTxns); } while (deadTxns.size() > 0); LOG.debug("Going to commit");
if (deadTxns.size() > 0) abortTxns(dbConn, deadTxns); } while (deadTxns.size() > 0); LOG.debug("Going to commit");
public void abortTxn(AbortTxnRequest rqst) throws NoSuchTxnException, MetaException { long txnid = rqst.getTxnid(); try { Connection dbConn = null; try { dbConn = getDbConn(Connection.TRANSACTION_SERIALIZABLE); if (abortTxns(dbConn, Collections.singletonList(txnid)) != 1) { LOG.debug("Going to rollback"); dbConn.rollback(); throw new NoSuchTxnException("No such transaction: " + txnid); } LOG.debug("Going to commit"); dbConn.commit(); } catch (SQLException e) { LOG.debug("Going to rollback"); rollbackDBConn(dbConn); checkRetryable(dbConn, e, "abortTxn(" + rqst + ")"); throw new MetaException("Unable to update transaction database " + StringUtils.stringifyException(e)); } finally { closeDbConn(dbConn); } } catch (RetryException e) { abortTxn(rqst); } }
public void abortTxn(AbortTxnRequest rqst) throws NoSuchTxnException, MetaException { long txnid = rqst.getTxnid(); try { Connection dbConn = null; try { dbConn = getDbConn(Connection.TRANSACTION_SERIALIZABLE); if (abortTxns(dbConn, Collections.singletonList(txnid)) != 1) { LOG.debug("Going to rollback"); dbConn.rollback(); throw new NoSuchTxnException("No such transaction: " + txnid); } LOG.debug("Going to commit"); dbConn.commit(); } catch (SQLException e) { LOG.debug("Going to rollback"); rollbackDBConn(dbConn); checkRetryable(dbConn, e, "abortTxn(" + rqst + ")"); throw new MetaException("Unable to update transaction database " + StringUtils.stringifyException(e)); } finally { closeDbConn(dbConn); } } catch (RetryException e) { abortTxn(rqst); } }