You are here

protected function Connection::doCommit in Drupal 8

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/Database/Connection.php \Drupal\Core\Database\Connection::doCommit()

Do the actual commit, invoke post-commit callbacks.

@internal

2 calls to Connection::doCommit()
Connection::popCommittableTransactions in core/lib/Drupal/Core/Database/Connection.php
Commit all the transaction layers that can commit.
Connection::popCommittableTransactions in core/lib/Drupal/Core/Database/Driver/mysql/Connection.php
Overridden to work around issues to MySQL not supporting transactional DDL.

File

core/lib/Drupal/Core/Database/Connection.php, line 1304

Class

Connection
Base Database API class.

Namespace

Drupal\Core\Database

Code

protected function doCommit() {
  $success = $this->connection
    ->commit();
  if (!empty($this->rootTransactionEndCallbacks)) {
    $callbacks = $this->rootTransactionEndCallbacks;
    $this->rootTransactionEndCallbacks = [];
    foreach ($callbacks as $callback) {
      call_user_func($callback, $success);
    }
  }
  if (!$success) {
    throw new TransactionCommitFailedException();
  }
}