Rollback changes made and handle any type of error raised by the DBMS.
350511
def handle_database_error(cls, session, exception):
        """"""

        session.rollback()

        if isinstance(exception, IntegrityError):
            cls.handle_integrity_error(exception)
        elif isinstance(exception, FlushError):
            cls.handle_flush_error(exception)
        else:
            raise exception
360903
def rollback(self):
        """"""
        self._check_state()
        database = self._session._database
        api = database.spanner_api
        metadata = _metadata_with_prefix(database.name)
        api.rollback(self._session.name, self._transaction_id, metadata=metadata)
        self._rolled_back = True
        del self._session._transaction
920077
protected function _rollback( $dbname = 'db' )
	{
		$dbm = $this->_context->getDatabaseManager();

		$conn = $dbm->acquire( $dbname );
		$conn->rollback();
		$dbm->release( $conn, $dbname );
	}
147011
public function rollBack()
	{
		if ( $this->transactionCount < 1 ) {
			return;
		}
		$transaction = $this->unprepared( "ROLLBACK;" );
		if ( false !== $transaction ) {
			$this->transactionCount --;
		}
	}
492642
public function rollback() {
        try {
            $this->getTransaction()->rollback();
        } catch(Failed $e) {
            if($e->getMessage() != 'Transaction aborted') {
                throw $e;
            }
        } catch(DbException $e) {
            if($e->getMessage() != 'There is no active transaction') {
                throw $e;
            }
        }
        $transactions = $this->getTransactions();
        unset($transactions[$this->getDbService()]);
        $this->setTransactions($transactions);

        $this->findEventsManager()->fire(self::EVENT_ROLLBACK, $this);
    }
270587
function rollback() {
    var parsed = ensureConfig();
    var name = parsed.name;
    // check if is an index number.
    // if yes try to lookup the id
    // by its index.
    try {
        var idx = void 0;
        if (/^[0-9]+$/.test(name)) {
            idx = parseInt(parsed.name) - 1;
            if (idx >= 0) {
                var keys = Object.keys(mu.rollbacks);
                var key = keys[idx];
                if (key)
                    name = key;
            }
        }
    }
    catch (ex) { }
    mu.rollback(parsed.name, parsed.output);
}
1331733
public void clearErrors() {

        if ((getAliasError() != null) || (getPathError() != null)) {
            // ensure rows with errors are updated correctly
            m_isChanged = true;
        }
        m_pathError = null;
        m_aliasError = null;
    }
938903
public function rollback()
    {
        if (!$this->recv) {
            $this->receive();
            App::error('You forget to getResult() before rollback !');
        }
        $this->connection->query('rollback;');
    }
1067809
public function rollBack()
    {
        try {
            $this->rows = $this->snapshot;

            $this->storeAllTables();

            $this->snapshot = [];
        } catch (\Exception $e) {
            throw new \RuntimeException('Rollback failed: ' . $e->getMessage(), 0, $e);
        }
    }
888680
public void rollback() {
		for (TransactionLifecycleListener l : lifecycleListeners) {

			l.onTxRollback(this);
		}

		if (logger.isLoggable(Level.FINE))
			logger.fine("transaction " + txNum + " rolled back");
	}
1122706
public function trans_rollback()
    {
        $this->conn(); //connect server
        $this->db->rollback();
        $this->db->autocommit(true);
    }
431941
protected function rollback_transaction() {
        $this->query_start('--oracle_rollback', NULL, SQL_QUERY_AUX);
        $result = oci_rollback($this->oci);
        $this->commit_status = OCI_COMMIT_ON_SUCCESS;
        $this->query_end($result);
    }
640155
def _reset(self, force=False):
        
        if not self._closed and (force or self._transaction):
            try:
                self.rollback()
            except Exception:
                pass
1368237
private void rollback(Transaction txn, Exception cause) throws Exception {
        try {
            txn.rollback();
        } catch (Exception e) {
            logger.debug(e, "Error while rolling back transaction " + txn);
        } finally {
            throw cause;
        }
    }
1024226
public function rollback()
	{
		try
		{
			if( --$this->_txnumber === 0 )
			{
				if( $this->_connection->rollBack() === false ) {
					throw new MW_DB_Exception( 'Failed to roll back transaction' );
				}
			}
		}
		catch( PDOException $e )
		{
			throw new MW_DB_Exception( $e->getMessage(), $e->getCode(), $e->errorInfo );
		}
	}
1235914
def rollback(self) -> None:
        
        if len(self._transactions) == 0:
            raise RuntimeError("rollback called outside transaction")

        _debug("rollback:", self._transactions[-1])
        # if something goes wrong here, nothing we can do about it, leave
        # database as is.
        try:
            # for every rollback action ...
            for on_rollback in self._transactions[-1]:
                # execute it
                _debug("--> rolling back", on_rollback)
                self._do_with_retry(on_rollback)
        except:  # noqa: E722
            _debug("--> rollback failed")
            exc_class, exc, tb = sys.exc_info()
            raise tldap.exceptions.RollbackError(
                "FATAL Unrecoverable rollback error: %r" % exc)
        finally:
            # reset everything to clean state
            _debug("--> rollback success")
            self.reset()
1341397
public function rollback()
    {
        $context = $this->_context;

        if ($context->transaction_level > 0) {
            $this->logger->info('transaction rollback', 'db.transaction.rollback');
            $context->transaction_level--;

            if ($context->transaction_level === 0) {
                $this->eventsManager->fireEvent('db:rollbackTransaction', $this);

                try {
                    if (!$context->connection->rollBack()) {
                        throw new DbException('rollBack failed.');
                    }
                } catch (\PDOException $exception) {
                    throw new DbException('rollBack failed: ' . $exception->getMessage(), $exception->getCode(), $exception);
                } finally {
                    $this->poolManager->push($this, $context->connection);
                    $context->connection = null;
                }
            }
        }
    }