public function Connection::popTransaction

Same name in this branch
  1. 8.x drupal/core/lib/Drupal/Core/Database/Connection.php \Drupal\Core\Database\Connection::popTransaction()
  2. 8.x drupal/core/lib/Drupal/Core/Database/Driver/sqlite/Connection.php \Drupal\Core\Database\Driver\sqlite\Connection::popTransaction()

Decreases the depth of transaction nesting.

If we pop off the last transaction layer, then we either commit or roll back the transaction as necessary. If no transaction is active, we return because the transaction may have manually been rolled back.

Parameters

$name: The name of the savepoint

Throws

Drupal\Core\Database\TransactionNoActiveException

Drupal\Core\Database\TransactionCommitFailedException

See also

DatabaseTransaction

1 call to Connection::popTransaction()
Connection::popTransaction in drupal/core/lib/Drupal/Core/Database/Driver/sqlite/Connection.php
Decreases the depth of transaction nesting.
1 method overrides Connection::popTransaction()
Connection::popTransaction in drupal/core/lib/Drupal/Core/Database/Driver/sqlite/Connection.php
Decreases the depth of transaction nesting.

File

drupal/core/lib/Drupal/Core/Database/Connection.php, line 989
Definition of Drupal\Core\Database\Connection

Class

Connection
Base Database API class.

Namespace

Drupal\Core\Database

Code

public function popTransaction($name) {
  if (!$this
    ->supportsTransactions()) {
    return;
  }

  // The transaction has already been committed earlier. There is nothing we
  // need to do. If this transaction was part of an earlier out-of-order
  // rollback, an exception would already have been thrown by
  // Database::rollback().
  if (!isset($this->transactionLayers[$name])) {
    return;
  }

  // Mark this layer as committable.
  $this->transactionLayers[$name] = FALSE;
  $this
    ->popCommittableTransactions();
}