function Connection::doCommit

Same name in this branch
  1. 9 core/modules/mysql/src/Driver/Database/mysql/Connection.php \Drupal\mysql\Driver\Database\mysql\Connection::doCommit()
Same name in other branches
  1. 8.9.x core/lib/Drupal/Core/Database/Connection.php \Drupal\Core\Database\Connection::doCommit()
  2. 10 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::doCommit in core/modules/mysql/src/Driver/Database/mysql/Connection.php
Do the actual commit, invoke post-commit callbacks.
Connection::popCommittableTransactions in core/lib/Drupal/Core/Database/Connection.php
Commit all the transaction layers that can commit.
1 method overrides Connection::doCommit()
Connection::doCommit in core/modules/mysql/src/Driver/Database/mysql/Connection.php
Do the actual commit, invoke post-commit callbacks.

File

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

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();
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.