Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. TransactionManagerInterface.php

function TransactionManagerInterface::rollback

Rolls back a Drupal transaction.

Rollbacks for nested transactions need to occur in reverse order to the pushes to the stack. Rolling back the last active Drupal transaction leads to rolling back the client connection (or to committing it in the edge case when the root was unpiled earlier).

This method should only be called internally by a database driver.

Parameters

string $name: The name of the transaction.

string $id: The id of the transaction.

Throws

\Drupal\Core\Database\TransactionNoActiveException If there is no active client connection.

\Drupal\Core\Database\TransactionOutOfOrderException If the order of rollback is not in reverse sequence against the pushes to the stack.

\Drupal\Core\Database\TransactionCommitFailedException If the commit of the root transaction failed.

1 method overrides TransactionManagerInterface::rollback()
TransactionManagerBase::rollback in core/lib/Drupal/Core/Database/Transaction/TransactionManagerBase.php
Rolls back a Drupal transaction.

File

core/lib/Drupal/Core/Database/Transaction/TransactionManagerInterface.php, line 96

Class

TransactionManagerInterface
Interface for the database transaction manager classes.

Namespace

Drupal\Core\Database\Transaction

Code

public function rollback(string $name, string $id) : void;
RSS feed
Powered by Drupal