public function Transaction::commit in Drupal driver for SQL Server and SQL Azure 8
Same name and namespace in other branches
- 8.2 drivers/lib/Drupal/Driver/Database/sqlsrv/Transaction.php \Drupal\Driver\Database\sqlsrv\Transaction::commit()
Commits the transaction. Only available for SANE transactions.
Throws
DatabaseTransactionExplicitCommitNotAllowedException
File
- drivers/
lib/ Drupal/ Driver/ Database/ sqlsrv/ Transaction.php, line 103 - Definition of Drupal\Driver\Database\sqlsrv\Transaction
Class
Namespace
Drupal\Driver\Database\sqlsrvCode
public function commit() {
// Insane transaction behaviour does not allow explicit commits.
if (!$this->settings
->Get_Sane()) {
throw new DatabaseTransactionExplicitCommitNotAllowedException();
}
// Cannot commit a rolledback transaction...
if ($this->rolledBack) {
throw new DatabaseTransactionCannotCommitAfterRollbackException();
}
// Mark as commited, and commit!
$this->commited = TRUE;
// Do not pop the transaction if this features is not enabled.
if ($this->connection->driver_settings
->GetEnableTransactions() === FALSE) {
return;
}
// Finally pop it!
$this->connection
->popTransaction($this->name);
}