[Zodb-checkins] CVS: ZODB3/ZODB - Connection.py:1.98.6.5 DB.py:1.53.4.3

Jeremy Hylton jeremy at zope.com
Mon Jul 7 15:11:28 EDT 2003


Update of /cvs-repository/ZODB3/ZODB
In directory cvs.zope.org:/tmp/cvs-serv25817/ZODB

Modified Files:
      Tag: zodb33-devel-branch
	Connection.py DB.py 
Log Message:
Remove some circular reference band-aids from the ZODB trunk.

Get rid of dodgy _breakcr() code, which was causing segfaults in weird
places.  We'll rely on GC instead.

Remove clear() method on cache, since it was only called from _breakcr().

Call ghostify() from Per_clear() to attempt to free references in a
clean way.  This may not be necessary when the rest of GC support gets
implemented.

Make DB and Connection new-style classes to aid in debugging.


=== ZODB3/ZODB/Connection.py 1.98.6.4 => 1.98.6.5 ===
--- ZODB3/ZODB/Connection.py:1.98.6.4	Tue Jul  1 17:03:43 2003
+++ ZODB3/ZODB/Connection.py	Mon Jul  7 14:11:21 2003
@@ -42,7 +42,7 @@
     global global_code_timestamp
     global_code_timestamp = time()
 
-class Connection(ExportImport.ExportImport):
+class Connection(ExportImport.ExportImport, object):
     """Object managers for individual object space.
 
     An object space is a version of collection of objects.  In a
@@ -125,17 +125,6 @@
         else:
             ver = ''
         return '<Connection at %08x%s>' % (id(self), ver)
-
-    def _breakcr(self):
-        # Persistent objects and the cache don't participate in GC.
-        # Explicitly remove references from the connection to its
-        # cache and to the root object, because they refer back to the
-        # connection.
-        self._cache.clear()
-        self._cache = None
-        self._incrgc = None
-        self.cacheGC = None
-        self._root_ = None
 
     def __getitem__(self, oid):
         obj = self._cache.get(oid, None)


=== ZODB3/ZODB/DB.py 1.53.4.2 => 1.53.4.3 ===
--- ZODB3/ZODB/DB.py:1.53.4.2	Tue Jul  1 16:57:18 2003
+++ ZODB3/ZODB/DB.py	Mon Jul  7 14:11:21 2003
@@ -32,7 +32,7 @@
         d[elt] = 1
     return d
 
-class DB(UndoLogCompatible.UndoLogCompatible):
+class DB(UndoLogCompatible.UndoLogCompatible, object):
     """The Object Database
 
     The Object database coordinates access to and interaction of one
@@ -267,9 +267,6 @@
 
     def close(self):
         self._storage.close()
-        for x, allocated in self._pools[1]:
-            for c in allocated:
-                c._breakcr()
 
     def commitVersion(self, source, destination='', transaction=None):
         if transaction is None:




More information about the Zodb-checkins mailing list