Rollback the currently open XA transaction
559694
function (conn, opts) {
            opts = opts || {};
            var s = opts.prepare;
            var logConnectionExecute = comb("__logConnectionExecute");
            if (s) {
                s = this.literal(s);
                var self = this;
                return this.__logConnectionExecute(conn, "XA END " + s)
                    .chain(function () {
                        return self.__logConnectionExecute(conn, "XA PREPARE " + s);
                    })
                    .chain(function () {
                        return self.__logConnectionExecute(conn, "XA ROLLBACK " + s);
                    });
            } else {
                return this._super(arguments);
            }
        }
904620
void rollback(Transaction tx) {
		ReversibleIterator<LogRecord> iter = new LogRecordIterator();
		LogSeqNum txUnDoNextLSN = null;
		while (iter.hasNext()) {
			LogRecord rec = iter.next();
			if (rec.txNumber() == txNum) {
				if (txUnDoNextLSN != null) {
					if (txUnDoNextLSN.compareTo(rec.getLSN()) != 1)
						continue;
				}
				if (rec.op() == OP_START)
					return;
				else if (rec instanceof LogicalEndRecord) {

					// Undo this Logical operation;
					rec.undo(tx);
					/*
					 * Extract the logicalStartLSN form rec by casting it as a
					 * LogicalEndRecord
					 */
					LogSeqNum logicalStartLSN = ((LogicalEndRecord) rec).getlogicalStartLSN();

					/*
					 * Save the Logical Start LSN to skip the log records
					 * between the end record and the start record
					 */
					txUnDoNextLSN = logicalStartLSN;

				} else
					rec.undo(tx);
			}
		}
	}
58516
public function rollBack()
    {
        if ($this->transactionNestingLevel === 0) {
            throw ConnectionException::noActiveTransaction();
        }

        $connection = $this->getWrappedConnection();

        $logger = $this->_config->getSQLLogger();

        if ($this->transactionNestingLevel === 1) {
            if ($logger) {
                $logger->startQuery('"ROLLBACK"');
            }
            $this->transactionNestingLevel = 0;
            $connection->rollBack();
            $this->isRollbackOnly = false;
            if ($logger) {
                $logger->stopQuery();
            }

            if ($this->autoCommit === false) {
                $this->beginTransaction();
            }
        } elseif ($this->nestTransactionsWithSavepoints) {
            if ($logger) {
                $logger->startQuery('"ROLLBACK TO SAVEPOINT"');
            }
            $this->rollbackSavepoint($this->_getNestedTransactionSavePointName());
            --$this->transactionNestingLevel;
            if ($logger) {
                $logger->stopQuery();
            }
        } else {
            $this->isRollbackOnly = true;
            --$this->transactionNestingLevel;
        }
    }
1034233
def rollback(self):
        """"""
        if not self._in_transaction:
            raise NotInTransaction
        self._init_cache()
        self._in_transaction = False
759830
async def rollback_prepared(self, xid, *, is_prepared=True):
        """"""
        if not is_prepared:
            await self.execute("XA END '%s'" % xid)
        await self.execute("XA ROLLBACK '%s'" % xid)
882998
def UndoTransaction(self):
		
		from Ucs import ConfigMap

		self._transactionInProgress = False
		self._configMap = ConfigMap()
771121
def rollback(self):
        
        try:
            if self._autocommit:
                return

            if not self._conn or not self._conn.is_connected():
                return

            if not self._conn.tds72_transaction:
                return

            self._main_cursor._rollback(cont=True,
                                        isolation_level=self._isolation_level)
        except socket.error as e:
            if e.errno in (errno.ENETRESET, errno.ECONNRESET, errno.EPIPE):
                return
            self._conn.close()
            raise
        except ClosedConnectionError:
            pass
1330974
@Override
    public void rollback() throws BackendException {
        Throwable excep = null;
        for (IndexTransaction itx : indexTx.values()) {
            try {
                itx.rollback();
            } catch (Throwable e) {
                excep = e;
            }
        }
        storeTx.rollback();
        if (excep!=null) { //throw any encountered index transaction rollback exceptions
            if (excep instanceof BackendException) throw (BackendException)excep;
            else throw new PermanentBackendException("Unexpected exception",excep);
        }
    }
1218773
public void rollback() throws ResourceException {
        if (tc.isEntryEnabled())
            Tr.entry(this, tc, "rollback", ivMC);

        // if the MC marked Stale, it means the user requested a purge pool with an immediate option
        // so don't allow any work on the mc
        if (ivMC._mcStale) {
            if (tc.isDebugEnabled())
                Tr.debug(this, tc, "MC is stale");
            throw new DataStoreAdapterException("INVALID_CONNECTION", AdapterUtil.staleX(), WSRdbSpiLocalTransactionImpl.class);
        }

        if (!ivMC.isTransactional()) { // do nothing if no enlistment
            if (tc.isEntryEnabled())
                Tr.exit(this, tc, "rollback", "no-op.  Enlistment disabled");
            return;
        }

        ResourceException re;

        if (tc.isDebugEnabled()) {
            String cId = null;
            try {
                cId = ivMC.mcf.getCorrelator(ivMC); 
            } catch (SQLException x) {
                // will just log the exception here and ignore it since its in trace
                Tr.debug(
                         tc,
                         "got an exception trying to get the correlator, exception is: ",
                         x);
            }

            if (cId != null) {
                StringBuffer stbuf = new StringBuffer(200);
                stbuf.append("Correlator: DB2, ID: ");
                stbuf.append(cId);
                stbuf.append(" Transaction : ");
                stbuf.append(this);
                stbuf.append("ROLLBACK");

                Tr.debug(this, tc, stbuf.toString());
            }
        }


        re = ivStateManager.isValid(WSStateManager.LT_ROLLBACK); 

        if (re == null)
            try 
            {
                // If no work was done during the transaction, the autoCommit value may still
                // be on.  In this case, just no-op, since some drivers like ConnectJDBC 3.1
                // don't allow commit/rollback when autoCommit is on.  

                //  here the autocommit is always false, so we can call commit.
                ivConnection.rollback();

                //Note this exception is not caught - This is because
                //  1)  it is of type ResourceException so it can be thrown from the method
                //  2)  if isValid is okay, this should never fail.  If isValid is not okay
                //     an exception is thrown from there
                // Already validated the state in this sync block, so just set it. 
                ivStateManager.transtate = WSStateManager.NO_TRANSACTION_ACTIVE;
            } 
            catch (SQLException se) {
                if (!ivMC.isAborted())
                    FFDCFilter.processException(se, getClass().getName(), "192", this);

                ResourceException resX = AdapterUtil.translateSQLException(se, ivMC, true, currClass);
                if (tc.isEntryEnabled())
                    Tr.exit(this, tc, "rollback", "Exception"); 
                throw resX;
            }
        else 
        {
            // state change was not valid

            LocalTransactionException local_tran_excep =
                            new LocalTransactionException(re.getMessage());

            DataStoreAdapterException dsae = new DataStoreAdapterException(
                                            "WS_INTERNAL_ERROR",
                                            local_tran_excep,
                                            currClass,
                                            "Cannot rollback SPI local transaction.",
                                            "",
                                            local_tran_excep.getMessage());
            // Use FFDC to log the possible components list. 
            FFDCFilter.processException(
                                        dsae,
                                        "com.ibm.ws.rsadapter.spi.WSRdbSpiLocalTransactionImpl.rollback",
                                        "291",
                                        this,
                                        new Object[] { " Possible components: WebSphere J2C Implementation" });
            if (tc.isEntryEnabled())
                Tr.exit(this, tc, "rollback", "Exception"); 
            throw dsae;
        }

        // Reset so we can deferred enlist in a future global transaction. 
        ivMC.wasLazilyEnlistedInGlobalTran = false; 

        if (tc.isEventEnabled())
            Tr.event(
                     tc,
                     "SpiLocalTransaction rolled back.  ManagedConnection state is "
                                     + ivMC.getTransactionStateAsString());

        if (tc.isEntryEnabled())
            Tr.exit(this, tc, "rollback");
    }
847108
public void doRollback(DefaultTransactionStatus status) throws TransactionException {
		CompensatingTransactionObject txObject = (CompensatingTransactionObject) status.getTransaction();
		txObject.getHolder().getTransactionOperationManager().rollback();
	}
1341377
@Override
	public void rollback() {
		Optional<LocalTransactionContext> txContext = currentTxContext();
		if (txContext.isPresent()) {
			txContext.get().rollback();
		} else {
			this.unmanagedTransaction.ifPresent(LocalTransactionContext::rollback);
		}
	}
130498
public function rollBackTransaction() {
        // check that a transaction is really active
        if (!$this->getConnection(false)->inTransaction())
            throw new \Exception("Not inside a DB transaction. Cannot commit.");

        try {
            $this->getConnection(false)->rollBack();
        } catch (Exception $_e) {
            throw new \Exception("Error while rolling back DB transaction: ".$pe->getMessage());
        }
    }
1186654
void rollbackPartial(Session session, int start, long timestamp) {

        Object[] list  = session.rowActionList.getArray();
        int      limit = session.rowActionList.size();

        if (start == limit) {
            return;
        }

        for (int i = start; i < limit; i++) {
            RowAction action = (RowAction) list[i];

            if (action != null) {
                action.rollback(session, timestamp);
            } else {
                System.out.println("null action in rollback " + start);
            }
        }

        // rolled back transactions can always be merged as they have never been
        // seen by other sessions
        mergeRolledBackTransaction(session.rowActionList.getArray(), start,
                                   limit);
        rowActionMapRemoveTransaction(session.rowActionList.getArray(), start,
                                      limit, false);
        session.rowActionList.setSize(start);
    }
1342212
public function rollback()
    {
        if (!empty($this->transactions)) {
            $t = array_pop($this->transactions);
            $this->data = $t['data'];
            $this->lastAI = $t['lastAI'];
        }
        $this->log('ROLLBACK');
    }
1295395
public static void rollback()
   {
      try {
         if (userTransaction.getStatus() != Status.STATUS_NO_TRANSACTION) {
            userTransaction.rollback();
         }
         else {
            LOGGER.warn("Request to rollback transaction when none was in started.");
         }
      }
      catch (Exception e) {
         LOGGER.warn("Transaction rollback failed.", e);
      }
   }
146010
@Override
    public void rollback(String globalId) throws HeuristicHazardException, HeuristicCommitException, HeuristicMixedException, SystemException {

        final TransactionWrapper t = TransactionWrapper.getTransactionWrapper(globalId);

        if (t != null) {
            t.rollback();
        } else {
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                Tr.debug(tc, "No matching TransactionWrapper: " + globalId);
            throw new SystemException();
        }
    }
1138237
def rollback(using=None):
    
    if using is None:
        for using in tldap.backend.connections:
            connection = tldap.backend.connections[using]
            connection.rollback()
        return
    connection = tldap.backend.connections[using]
    connection.rollback()