Skip to content
Snippets Groups Projects

Issue #3364706: Refactor transactions

Closed mondrake requested to merge issue/drupal-3364706:3364706-refactor-transactions into 11.x
Compare and
16 files
+ 1114
140
Compare changes
  • Side-by-side
  • Inline
Files
16
@@ -68,7 +68,14 @@ public function invalidateTags(array $tags) {
$in_transaction = $this->getDatabaseConnection()->inTransaction();
if ($in_transaction) {
if (empty($this->delayedTags)) {
$this->getDatabaseConnection()->addRootTransactionEndCallback([$this, 'rootTransactionEndCallback']);
// @todo in drupal:11.0.0, remove the conditional and only call the
// TransactionManager().
if ($this->getDatabaseConnection()->transactionManager()) {
$this->getDatabaseConnection()->transactionManager()->addPostTransactionCallback([$this, 'rootTransactionEndCallback']);
}
else {
$this->getDatabaseConnection()->addRootTransactionEndCallback([$this, 'rootTransactionEndCallback']);
}
}
$this->delayedTags = Cache::mergeTags($this->delayedTags, $tags);
}
Loading