Commit 9f26c569 authored by catch's avatar catch

Issue #2801899 by shashikant_chauhan, daffie, axel.rutz: Rename...

Issue #2801899 by shashikant_chauhan, daffie, axel.rutz: Rename Drupal\Core\Database\Connection::rollback() to Drupal\Core\Database\Connection::rollBack()
parent 55469c50
......@@ -1083,9 +1083,9 @@ public function startTransaction($name = '') {
* @throws \Drupal\Core\Database\TransactionOutOfOrderException
* @throws \Drupal\Core\Database\TransactionNoActiveException
*
* @see \Drupal\Core\Database\Transaction::rollback()
* @see \Drupal\Core\Database\Transaction::rollBack()
*/
public function rollback($savepoint_name = 'drupal_transaction') {
public function rollBack($savepoint_name = 'drupal_transaction') {
if (!$this->supportsTransactions()) {
return;
}
......@@ -1179,7 +1179,7 @@ public function popTransaction($name) {
// The transaction has already been committed earlier. There is nothing we
// need to do. If this transaction was part of an earlier out-of-order
// rollback, an exception would already have been thrown by
// Database::rollback().
// Database::rollBack().
if (!isset($this->transactionLayers[$name])) {
return;
}
......
......@@ -432,7 +432,7 @@ public function releaseSavepoint($savepoint_name = 'mimic_implicit_commit') {
*/
public function rollbackSavepoint($savepoint_name = 'mimic_implicit_commit') {
if (isset($this->transactionLayers[$savepoint_name])) {
$this->rollback($savepoint_name);
$this->rollBack($savepoint_name);
}
}
......
......@@ -59,7 +59,7 @@ public function execute() {
}
catch (\Exception $e) {
// One of the queries failed, rollback the whole batch.
$transaction->rollback();
$transaction->rollBack();
// Rethrow the exception for the calling code.
throw $e;
......
......@@ -91,7 +91,7 @@ public function execute() {
}
catch (\Exception $e) {
// One of the INSERTs failed, rollback the whole batch.
$transaction->rollback();
$transaction->rollBack();
// Rethrow the exception for the calling code.
throw $e;
}
......
......@@ -86,12 +86,12 @@ public function name() {
* transaction has been rolled back or the log messages will be rolled back
* too.
*
* @see \Drupal\Core\Database\Connection::rollback()
* @see \Drupal\Core\Database\Connection::rollBack()
* @see watchdog_exception()
*/
public function rollback() {
public function rollBack() {
$this->rolledBack = TRUE;
$this->connection->rollback($this->name);
$this->connection->rollBack($this->name);
}
}
......@@ -3,6 +3,6 @@
namespace Drupal\Core\Database;
/**
* Exception thrown when a rollback() resulted in other active transactions being rolled-back.
* Exception thrown when a rollBack() resulted in other active transactions being rolled-back.
*/
class TransactionOutOfOrderException extends TransactionException implements DatabaseException { }
......@@ -175,7 +175,7 @@
* }
* catch (Exception $e) {
* // Something went wrong somewhere, so roll back now.
* $txn->rollback();
* $txn->rollBack();
* // Log the exception to watchdog.
* watchdog_exception('type', $e);
* }
......
......@@ -713,7 +713,7 @@ public function delete(array $entities) {
db_ignore_replica();
}
catch (\Exception $e) {
$transaction->rollback();
$transaction->rollBack();
watchdog_exception($this->entityTypeId, $e);
throw new EntityStorageException($e->getMessage(), $e->getCode(), $e);
}
......@@ -765,7 +765,7 @@ public function save(EntityInterface $entity) {
return $return;
}
catch (\Exception $e) {
$transaction->rollback();
$transaction->rollBack();
watchdog_exception($this->entityTypeId, $e);
throw new EntityStorageException($e->getMessage(), $e->getCode(), $e);
}
......
......@@ -316,7 +316,7 @@ public function onEntityTypeUpdate(EntityTypeInterface $entity_type, EntityTypeI
}
catch (\Exception $e) {
if ($this->database->supportsTransactionalDDL()) {
$transaction->rollback();
$transaction->rollBack();
}
else {
// Recreate original schema.
......@@ -1271,7 +1271,7 @@ protected function updateDedicatedTableSchema(FieldStorageDefinitionInterface $s
}
catch (\Exception $e) {
if ($this->database->supportsTransactionalDDL()) {
$transaction->rollback();
$transaction->rollBack();
}
else {
// Recreate tables.
......@@ -1362,7 +1362,7 @@ protected function updateSharedTableSchema(FieldStorageDefinitionInterface $stor
}
catch (\Exception $e) {
if ($this->database->supportsTransactionalDDL()) {
$transaction->rollback();
$transaction->rollBack();
}
else {
// Recreate original schema.
......
......@@ -63,7 +63,7 @@ protected function menuLinksRebuild() {
db_ignore_replica();
}
catch (\Exception $e) {
$transaction->rollback();
$transaction->rollBack();
watchdog_exception('menu', $e);
}
......
......@@ -315,7 +315,7 @@ protected function doSave(array $link) {
$this->updateParentalStatus($link);
}
catch (\Exception $e) {
$transaction->rollback();
$transaction->rollBack();
throw $e;
}
return $affected_menus;
......
......@@ -144,7 +144,7 @@ public function dump(array $options = array()) {
}
catch (\Exception $e) {
$transaction->rollback();
$transaction->rollBack();
watchdog_exception('Routing', $e);
throw $e;
}
......
......@@ -75,8 +75,8 @@ protected function transactionOuterLayer($suffix, $rollback = FALSE, $ddl_statem
if ($rollback) {
// Roll back the transaction, if requested.
// This rollback should propagate to the last savepoint.
$txn->rollback();
$this->assertTrue(($connection->transactionDepth() == $depth), 'Transaction has rolled back to the last savepoint after calling rollback().');
$txn->rollBack();
$this->assertTrue(($connection->transactionDepth() == $depth), 'Transaction has rolled back to the last savepoint after calling rollBack().');
}
}
......@@ -135,8 +135,8 @@ protected function transactionInnerLayer($suffix, $rollback = FALSE, $ddl_statem
if ($rollback) {
// Roll back the transaction, if requested.
// This rollback should propagate to the last savepoint.
$txn->rollback();
$this->assertTrue(($connection->transactionDepth() == $depth), 'Transaction has rolled back to the last savepoint after calling rollback().');
$txn->rollBack();
$this->assertTrue(($connection->transactionDepth() == $depth), 'Transaction has rolled back to the last savepoint after calling rollBack().');
}
}
......@@ -254,7 +254,7 @@ function testTransactionWithDdlStatement() {
unset($transaction2);
$transaction3 = db_transaction();
$this->insertRow('row');
$transaction3->rollback();
$transaction3->rollBack();
unset($transaction3);
unset($transaction);
$this->assertRowAbsent('row');
......@@ -267,7 +267,7 @@ function testTransactionWithDdlStatement() {
$transaction = db_transaction();
$this->insertRow('row');
$this->executeDDLStatement();
$transaction->rollback();
$transaction->rollBack();
unset($transaction);
$this->assertRowAbsent('row');
......@@ -280,7 +280,7 @@ function testTransactionWithDdlStatement() {
$transaction3 = db_transaction();
$this->insertRow('row');
unset($transaction3);
$transaction->rollback();
$transaction->rollBack();
unset($transaction);
$this->assertRowAbsent('row');
}
......@@ -293,7 +293,7 @@ function testTransactionWithDdlStatement() {
$this->executeDDLStatement();
// Rollback the outer transaction.
try {
$transaction->rollback();
$transaction->rollBack();
unset($transaction);
// @TODO: an exception should be triggered here, but is not, because
// "ROLLBACK" fails silently in MySQL if there is no transaction active.
......@@ -424,7 +424,7 @@ function testTransactionStacking() {
$transaction2 = db_transaction();
$this->insertRow('inner');
// Now rollback the inner transaction.
$transaction2->rollback();
$transaction2->rollBack();
unset($transaction2);
$this->assertTrue($database->inTransaction(), 'Still in a transaction after popping the outer transaction');
// Pop the outer transaction, it should commit.
......@@ -445,7 +445,7 @@ function testTransactionStacking() {
unset($transaction);
$this->assertTrue($database->inTransaction(), 'Still in a transaction after popping the outer transaction');
// Now rollback the inner transaction, it should rollback.
$transaction2->rollback();
$transaction2->rollBack();
unset($transaction2);
$this->assertFalse($database->inTransaction(), 'Transaction closed after popping the inner transaction');
$this->assertRowPresent('outer');
......@@ -463,7 +463,7 @@ function testTransactionStacking() {
$this->insertRow('inner2');
// Rollback the outer transaction.
try {
$transaction->rollback();
$transaction->rollBack();
unset($transaction);
$this->fail('Rolling back the outer transaction while the inner transaction is active resulted in an exception.');
}
......@@ -476,7 +476,7 @@ function testTransactionStacking() {
$this->pass('Trying to commit an inner transaction resulted in an exception.');
// Try to rollback one inner transaction.
try {
$transaction->rollback();
$transaction->rollBack();
unset($transaction2);
$this->fail('Trying to commit an inner transaction resulted in an exception.');
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment