Skip to content
Snippets Groups Projects

Leaving the savepoint in the transaction stack upon rollback is incorrect

Closed mondrake requested to merge issue/drupal-3407080:3407080-leaving-the-savepoint into 11.x
2 files
+ 108
5
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -318,9 +318,13 @@ public function rollback(string $name, string $id): void {
if ($this->getConnectionTransactionState() === ClientConnectionTransactionState::Active) {
if ($this->stackDepth() > 1 && $this->stack()[$id]->type === StackItemType::Savepoint) {
// Rollback the client transaction to the savepoint when the Drupal
// transaction is not a root one. The savepoint and therefore the
// client connection remain active.
// transaction is not a root one. Then, release the savepoint too. The
// client connection remains active.
$this->rollbackClientSavepoint($name);
$this->releaseClientSavepoint($name);
// The Transaction object remains open, and when it will get destructed
// no commit should happen. Void the stack item.
$this->voidStackItem($id);
}
elseif ($this->stackDepth() === 1 && $this->stack()[$id]->type === StackItemType::Root) {
// If this was the root Drupal transaction, we can rollback the client
Loading