diff --git a/core/lib/Drupal/Core/Routing/MatcherDumper.php b/core/lib/Drupal/Core/Routing/MatcherDumper.php index f129f02..93f9ae2 100644 --- a/core/lib/Drupal/Core/Routing/MatcherDumper.php +++ b/core/lib/Drupal/Core/Routing/MatcherDumper.php @@ -118,7 +118,8 @@ public function dump(array $options = array()) { // Delete any old records in this route set first, then insert the new ones. // That avoids stale data. The transaction makes it atomic to avoid // unstable router states due to random failures. - + + $transaction = $this->connection->startTransaction(); try { $this->connection->delete($this->tableName) ->condition('route_set', $options['route_set']) @@ -128,8 +129,7 @@ public function dump(array $options = array()) { // the queued routes. $this->routes = NULL; } catch (\Exception $e) { - $txn = $this->connection->startTransaction(); - $txn->rollback(); + $transaction->rollback(); watchdog_exception('Routing', $e); throw $e; }