You are here

public function DatabaseConnection_sqlsrv::popTransaction in Drupal driver for SQL Server and SQL Azure 7.3

Same name and namespace in other branches
  1. 7.2 sqlsrv/database.inc \DatabaseConnection_sqlsrv::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

DatabaseTransactionNoActiveException

DatabaseTransactionCommitFailedException

Overrides DatabaseConnection::popTransaction

See also

DatabaseTransaction

File

sqlsrv/database.inc, line 868
Database interface code for Microsoft SQL Server.

Class

DatabaseConnection_sqlsrv
Summary of DatabaseConnection_sqlsrv

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]['active'] = FALSE;
  $this
    ->popCommittableTransactions();
}