rollbackTransaction

Rollback a transaction. If a name is specified, the transaction is
rollback to the given savepoint. Otherwise, the whole transaction is
rollback.

@access protected
@param  string|null $name
@return ModelLayer  $this
503470
protected function rollbackTransaction($name = null)
    {
        $sql = "rollback transaction";
        if ($name !== null) {
            $sql = sprintf("rollback to savepoint %s", $this->escapeIdentifier($name));
        }

        $this->executeAnonymousQuery($sql);

        return $this;
    }
75702
public function getHasOneByRelationName($name)
    {
        if ($table = $this->getReferencingTable($name)) {
            if ($model = static::getModelFromTable($table)) {
                $refField = $this->getReferencingField($table, $name);

                return $this->hasOne($model, $refField);
            }
        }

        return null;
    }
458415
public function reverseTransform($name)
    {
        if (!$name) {
            return null;
        }

        $vendor = $this->vh->findVendorForName($name);

        if (null === $vendor) {
            $vendor = $this->vh->createVendor($name);
        }

        return $vendor;
    }
428856
public function beginTransaction(?string $savepoint = null): self
    {
        if (null === $savepoint) {
            if (!$this->inTransaction()) {
                $this->execute('BEGIN');
            }

        } elseif (!$this->inTransaction()) {
            throw new exceptions\RuntimeException(
                __METHOD__ . ': Savepoints can only be used in transaction blocks'
            );

        } else {
            $this->execute('SAVEPOINT ' . $savepoint);
        }

        return $this;
    }
1286598
public function startTransaction(string $name, array $context = [], float $start = null): Transaction
    {
        // Create and Store Transaction
        $this->transactionsStore->register(
            $this->eventFactory->createTransaction($name, array_replace_recursive($this->sharedContext, $context), $start)
        );

        // Start the Transaction
        $transaction = $this->transactionsStore->fetch($name);

        if (null === $start) {
            $transaction->start();
        }

        return $transaction;
    }
1019068
public function backtrace(string $name = null) : string
    {
        $exception = new ErrorException(
            $name ?? 'backtrace',
            0,
            1,
            debug_backtrace()[0]['file'],
            (int) debug_backtrace()[0]['line']
        );

        return $this->render($exception, 1);
    }
146196
public function rollback($unitName=""){

		if(empty($unitName))
			$unitName = PersistenceConfig::getDefaultUnit();
			
		$entityManager =  self::getEntityManager( $unitName );
		
		$entityManager->getConnection()->rollback();
	}
1137811
protected function notNullableValue(string $name): Closure
    {
        return function (Table $table) use ($name) {
            assert($table->hasColumn($name));
            $table->getColumn($name)->setNotnull(true);
        };
    }
482064
public function resetSqlPart($name)
    {
        $this->sqlParts[$name] = is_array($this->sqlParts[$name]) ? array() : null;
        $this->state = self::STATE_DIRTY;
        return $this;
    }
58466
public function rollbackPlugin($name)
    {
        /*
         * Remove the plugin database and version
         */
        if (!($plugin = $this->pluginManager->findByIdentifier($name))
            && $this->versionManager->purgePlugin($name)
        ) {
            $this->note('<info>Purged from database:</info> ' . $name);
            return $this;
        }

        if ($this->versionManager->removePlugin($plugin)) {
            $this->note('<info>Rolled back:</info> ' . $name);
            return $this;
        }

        $this->note('<error>Unable to find:</error> ' . $name);

        return $this;
    }
1197966
public function rollback()
    {
        parent::rollback();
        foreach ($this->getOriginalAll() as $collection) {
            if ($collection instanceof EmbedCollection) {
                $collection->rollback();
            }
        }
        return $this;
    }
335751
public function withAttribute($name, $callback = null)
    {
        if (is_array($name)) {
            foreach ($name as $key => $val) {
                $key = Db::parseName($key);

                $this->withAttr[$key] = $val;
            }
        } else {
            $name = Db::parseName($name);

            $this->withAttr[$name] = $callback;
        }

        return $this;
    }
798615
public function selectIssuerByKeyword($name)
    {
        if (!isset($this->_paymentMethodsArray))
            throw new Exception("No data loaded");
        foreach ($this->_paymentMethodsArray as $paymentMethod) {
            foreach ($paymentMethod["Issuers"] as $issuer) {
                if ($issuer["IssuerKeyword"] == strtoupper($name)) {
                    $this->_methodData = $paymentMethod;
                    $this->_issuerData = $issuer;
                    break;
                }
            }
        }
        return $this;
    }
50915
public function rollBack()
    {
        if ($this->transactionLevel === 0) {
            throw ConnectionException::noActiveTransaction();
        }

        if ($this->transactionLevel === 1) {
            $queryDebugger = $this->createQueryDebugger('ROLLBACK TRANSACTION');
            $this->getDriverConnection()->rollBack();
            $this->debugQuery($queryDebugger);
        } else {
            $this->exec($this->getPlatform()->getRollbackSavepointSQLQuery($this->generateSavepointName()));
        }

        $this->transactionLevel--;
    }
1049345
public function name($name = null)
        {
            if ($name === null) return $this->ruleName;

            $this->ruleName = $name;

            return $this;
        }
133532
public function rollbackTransaction()
    {
        if (!self::$transaction) {
            throw new TransactionException("There is no Active Transaction");
        }

        self::$transaction = false;
        foreach (self::$connectionList as $dbDriver) {
            $dbDriver->rollbackTransaction();
        }
    }
1077819
public function rollBack($toLevel = null)
    {
        // We allow developers to rollback to a certain transaction level. We will verify
        // that this given transaction level is valid before attempting to rollback to
        // that level. If it's not we will just return out and not attempt anything.
        $toLevel = is_null($toLevel)
                    ? $this->transactions - 1
                    : $toLevel;

        if ($toLevel < 0 || $toLevel >= $this->transactions) {
            return;
        }

        // Next, we will actually perform this rollback within this database and fire the
        // rollback event. We will also set the current transaction level to the given
        // level that was passed into this method so it will be right from here out.
        try {
            $this->performRollBack($toLevel);
        } catch (Exception $e) {
            $this->handleRollBackException($e);
        }

        $this->transactions = $toLevel;

        $this->fireConnectionEvent('rollingBack');
    }