protected function DatabaseConnection::popCommittableTransactions

Internal function: commit all the transaction layers that can commit.

2 calls to DatabaseConnection::popCommittableTransactions()
DatabaseConnection::popTransaction in drupal/includes/database/database.inc
Decreases the depth of transaction nesting.
DatabaseConnection::rollback in drupal/includes/database/database.inc
Rolls back the transaction entirely or to a named savepoint.
1 method overrides DatabaseConnection::popCommittableTransactions()
DatabaseConnection_mysql::popCommittableTransactions in drupal/includes/database/mysql/database.inc
Overridden to work around issues to MySQL not supporting transactional DDL.

File

drupal/includes/database/database.inc, line 1160
Core systems for the database layer.

Class

DatabaseConnection
Base Database API class.

Code

protected function popCommittableTransactions() {

  // Commit all the committable layers.
  foreach (array_reverse($this->transactionLayers) as $name => $active) {

    // Stop once we found an active transaction.
    if ($active) {
      break;
    }

    // If there are no more layers left then we should commit.
    unset($this->transactionLayers[$name]);
    if (empty($this->transactionLayers)) {
      if (!parent::commit()) {
        throw new DatabaseTransactionCommitFailedException();
      }
    }
    else {
      $this
        ->query('RELEASE SAVEPOINT ' . $name);
    }
  }
}