diff --git a/src/Entity/GroupSubgroupHandler.php b/src/Entity/GroupSubgroupHandler.php
index d8d0643e26b274ca7fa42e680f7b518c825b1c45..0dcffffe45d0b914d2e942da0e3b9ca8ada0c7af 100644
--- a/src/Entity/GroupSubgroupHandler.php
+++ b/src/Entity/GroupSubgroupHandler.php
@@ -190,7 +190,6 @@ class GroupSubgroupHandler extends SubgroupHandlerBase {
     // We do not call the parent here but instead write a few giant queries to
     // avoid performance issues when updating large trees of group entities.
     $this->acquireLock();
-    $transaction = NULL;
 
     // Keep local copies of the tree values before we clear it.
     $leaf_right = $leaf->getRight();