Rollback to an implicit savepoint.

@throws \PDOException
167312
private function onErrorRollback(callable $code)
    {
        if (!$this->pdo->inTransaction()) {
            return call_user_func($code);
        }
        
        $this->pdo->exec("SAVEPOINT onErrorRollback");
        try {
            $result = call_user_func($code);
        } catch (\Exception $e) {
            $this->pdo->exec("ROLLBACK TO SAVEPOINT onErrorRollback");
            throw $e;
        }
        $this->pdo->exec("RELEASE SAVEPOINT onErrorRollback");
        return $result;
    }
1119938
public function rollBack()
    {
        try {
            $this->connection->rollBack();
        } catch (DBALException $e) {
            throw new OrmException("Unable to start transaction.\n" . $e->getMessage(), 0, $e);
        }
    }
204013
protected function persist()
    {
        $this->db->beginTransaction();

        try {
            $user = $this->model->find($this->selectedUser);
            $user->update(['password' => Hash::make($this->password)]);
        } catch (Exception $e) {
            $this->db->rollBack();
            $this->warn('Could not persist to the database: ' . $e->getMessage());
        }

        $this->db->commit();
        $this->info('Password Updated');

    }
670492
public function commit()
    {
        if (!$this->isTransaction()) {
            throw new PDOException('There is no active transaction');
        }
        $ret = $this->pool->commit($this->_bingId);
        $this->_bingId = null;
        $this->_isTransaction = false;
        return $ret;
    }
1097599
public function rollback($savepoint = null){
		$this->connection->getDriver()->rollback($savepoint);
		$this->notifyObservers(ObserverInterface::ROLLBACK);
		return $this;
	}
324001
function commit() {
		$this->savepoint--;

		if ($this->savepoint == 0) {
			if ( ! \mysqli_commit($this->dbh)) {
				throw new Panic('Failed to commit transaction');
			}
		}
		else { // not finished with transaction yet
			\mysqli_query($this->dbh, 'RELEASE SAVEPOINT save'.$this->savepoint);
		}

		return $this;
	}
1168065
public function commit($savepoint = null){
		if(!$this->resource->commit()){
			$error = $this->resource->errorInfo();
			throw new DriverException("SQLSTATE[$error[0]]: $error[2]", $error[1]);
		}
	}
1371834
@Override
  public final void
    rollBackTransaction(final String pSavepointName) throws Exception {
    //according https://code.google.com/p/android/issues/detail?id=38706
    //its very easy to make simple things complicated
    if (getLogger().getIsShowDebugMessagesFor(getClass())) {
      getLogger().debug(null, SrvDatabase.class,
        "try to rollback to savepoint: " + pSavepointName);
    }
    executeQuery(";ROLLBACK TRANSACTION TO SAVEPOINT " + pSavepointName + ";");
  }
1043393
protected function save()
    {
        $this->db->createCommand()->update($this->tableName, [
            'updated_at' => time(),
            'data' => [serialize($this->_states), \PDO::PARAM_LOB],
            ], ['id' => $this->_id])->execute();
    }
13323
public function rollBack()
    {
        --$this->currentTransactionLevel;
        if ($this->currentTransactionLevel == 0 || !$this->nestable()) {
            parent::rollBack();
        } else {
            $this->exec("ROLLBACK TO SAVEPOINT LEVEL{$this->currentTransactionLevel}");
        }
    }
906250
public function commit() {
        try {
            $this->getTransaction()->commit();
        } 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_COMMIT, $this);
    }
1333061
public function rollback()
	{
		if (!$rollbackPoint = $this->mechanism->getRollbackPoint())
		{
			$this->output->error('There are no rollback points currently available');
		}

		$date = date('M jS, Y \a\t g:i:sa', $rollbackPoint);

		if ($this->output->isInteractive())
		{
			$proceed = $this->output->getResponse('Are you sure you want to rollback to the snapshot taken on ' . $date . '? [y|n]');

			if ($proceed == 'y' || $proceed == 'yes')
			{
				$result = $this->mechanism->rollback($rollbackPoint);

				if ($result)
				{
					$this->output->addLine('complete', 'success');
				}
				else
				{
					$this->output->error('Rollback failed');
				}
			}
			else
			{
				$this->output->addLine('Rollback aborted.', 'warning');
			}
		}
		else
		{
			if ($this->arguments->getOpt('f'))
			{
				$this->mechanism->rollback($rollbackPoint);
			}
			else
			{
				$this->output->addLine('Use the -f option to rollback to snapshot taken on ' . $date);
			}
		}
	}
1208054
public function rollbackTransaction(): bool
    {
        --$this->transactionLevel;

        if ($this->transactionLevel == 0) {
            $this->isProfiling() && $this->getLogger()->info('Rollback transaction');

            try {
                return $this->getPDO()->rollBack();
            } catch (\PDOException $e) {
                throw $this->mapException($e, "ROLLBACK TRANSACTION");
            }
        }

        $this->savepointRollback($this->transactionLevel + 1);

        return true;
    }
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);
        }
    }
1021149
public function save()
    {
        if (count($this) == 0) {
            return;
        }
        $helper = reset($this->rows);
        $qb = new QueryBuilder($helper->getTableName());
        $qb->setQueryType(QueryBuilder::QUERY_TYPE_UPDATE);
        $qb->setModelData($this);
        $qb->addWhere($helper->getPrimaryKey(), 'IN', $this->getPrimaryKeyList());
        $statement = $qb->getStatement();
        $statement->closeCursor();
    }
950804
public function rollback()
    {
        if (!$this->started) {
            throw new \RuntimeException('Cannot rollback transaction before start');
        }
        if (!$this->pdo->rollBack()) {
            throw new \RuntimeException('Failed to rollback transaction');
        }

        $this->started = false;
    }
1273442
public function postSave()
    {

        // check if the model already exists
        if ((!isset($this->revisionEnabled) || $this->revisionEnabled) && $this->updating) {
            // if it does, it means we're updating

            $changes_to_record = $this->changedRevisionableFields();

            $revisions = array();

            foreach ($changes_to_record as $key => $change) {
                $revisions[] = array(
                    'revisionable_type'     => $this->getMorphClass(),
                    'revisionable_id'       => $this->getKey(),
                    'key'                   => $key,
                    'old_value'             => array_get($this->originalData, $key),
                    'new_value'             => $this->updatedData[$key],
                    'user_id'               => $this->getSystemUserId(),
                    'created_at'            => new \DateTime(),
                    'updated_at'            => new \DateTime(),
                );
            }

            if (count($revisions) > 0) {
                $revision = static::newModel();
                \DB::table($revision->getTable())->insert($revisions);
            }
        }
    }