protected function DatabaseConnection::popCommittableTransactions in Drupal 7
Internal function: commit all the transaction layers that can commit.
2 calls to DatabaseConnection::popCommittableTransactions()
- DatabaseConnection::popTransaction in includes/
database/ database.inc - Decreases the depth of transaction nesting.
- DatabaseConnection::rollback in includes/
database/ database.inc - Rolls back the transaction entirely or to a named savepoint.
1 method overrides DatabaseConnection::popCommittableTransactions()
- DatabaseConnection_mysql::popCommittableTransactions in includes/
database/ mysql/ database.inc - Overridden to work around issues to MySQL not supporting transactional DDL.
File
- includes/
database/ database.inc, line 1207 - 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 (!$this->connection
->commit()) {
throw new DatabaseTransactionCommitFailedException();
}
}
else {
$this
->query('RELEASE SAVEPOINT ' . $name);
}
}
}