]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
Remove RootTransaction<->RootTransaction reference cycle
authorJakub Stasiak <jakub@stasiak.at>
Wed, 4 Jun 2014 08:56:13 +0000 (09:56 +0100)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sat, 18 Jul 2015 14:45:09 +0000 (10:45 -0400)
(cherry picked from commit 3ef00e816da042d4932be53b86f76db17c800842)

lib/sqlalchemy/engine/base.py

index c5eabac0d6f9ad71d878237f1cf64cca8ac03ad3..eaa435d45dbf1a7bd75a8638d7f91f983024d5f9 100644 (file)
@@ -1531,9 +1531,13 @@ class Transaction(object):
 
     def __init__(self, connection, parent):
         self.connection = connection
-        self._parent = parent or self
+        self._actual_parent = parent
         self.is_active = True
 
+    @property
+    def _parent(self):
+        return self._actual_parent or self
+
     def close(self):
         """Close this :class:`.Transaction`.