diff options
Diffstat (limited to 'includes')
-rw-r--r-- | includes/database/database.inc | 23 | ||||
-rw-r--r-- | includes/database/mysql/database.inc | 4 |
2 files changed, 4 insertions, 23 deletions
diff --git a/includes/database/database.inc b/includes/database/database.inc index 53732a982..1dc89fd14 100644 --- a/includes/database/database.inc +++ b/includes/database/database.inc @@ -873,17 +873,9 @@ abstract class DatabaseConnection extends PDO { /** * Returns a new DatabaseTransaction object on this connection. * - * @param $required - * If executing an operation that absolutely must use transactions, specify - * TRUE for this parameter. If the connection does not support transactions, - * this method will throw an exception and the operation will not be possible. * @see DatabaseTransaction */ - public function startTransaction($required = FALSE) { - if ($required && !$this->supportsTransactions()) { - throw new TransactionsNotSupportedException(); - } - + public function startTransaction() { if (empty($this->transactionClass)) { $this->transactionClass = 'DatabaseTransaction_' . $this->driver(); if (!class_exists($this->transactionClass)) { @@ -1601,18 +1593,7 @@ abstract class Database { } /** - * Exception to mark databases that do not support transations. - * - * This exception will be thrown when a transaction is started that does not - * allow for the "silent fallback" of no transaction and the database connection - * in use does not support transactions. The calling code must then take - * appropriate action. - */ -class TransactionsNotSupportedException extends Exception { } - -/** - * Exception to throw when popTransaction() is called when no transaction is - * active. + * Exception to throw when popTransaction() is called when no transaction is active. */ class NoActiveTransactionException extends Exception { } diff --git a/includes/database/mysql/database.inc b/includes/database/mysql/database.inc index bbe4ea70e..437d796e3 100644 --- a/includes/database/mysql/database.inc +++ b/includes/database/mysql/database.inc @@ -14,8 +14,8 @@ class DatabaseConnection_mysql extends DatabaseConnection { public function __construct(array $connection_options = array()) { - // This driver defaults to non transaction support. - $this->transactionSupport = !empty($connection_options['transactions']); + // This driver defaults to transaction support, except if explicitly passed FALSE. + $this->transactionSupport = !isset($connection_options['transactions']) || ($connection_options['transactions'] !== FALSE); // MySQL never supports transactional DDL. $this->transactionalDDLSupport = FALSE; |