DatabaseConnection::commit

  1. drupal
    1. 8
    2. 7
Versions
7 public DatabaseConnection::commit()

Throws an exception to deny direct access to transaction commits.

We do not want to allow users to commit transactions at any time, only by destroying the transaction object or allowing it to go out of scope. A direct commit bypasses all of the safety checks we've built on top of PDO's transaction routines.

Throws

DatabaseTransactionExplicitCommitNotAllowedException

See also

DatabaseTransaction

Code

includes/database/database.inc, line 1268

<?php
public function commit() {
  throw new DatabaseTransactionExplicitCommitNotAllowedException();
}
?>