[Zodb-checkins] CVS: Zope3/src/zodb - conflict.py:1.13 connection.py:1.26 export.py:1.7 serialize.py:1.19
Jeremy Hylton
jeremy@zope.com
Tue, 1 Apr 2003 15:22:05 -0500
Update of /cvs-repository/Zope3/src/zodb
In directory cvs.zope.org:/tmp/cvs-serv14476
Modified Files:
conflict.py connection.py export.py serialize.py
Log Message:
Close ObjecWriter() to avoid uncollectable cycle.
=== Zope3/src/zodb/conflict.py 1.12 => 1.13 ===
--- Zope3/src/zodb/conflict.py:1.12 Thu Mar 20 17:51:59 2003
+++ Zope3/src/zodb/conflict.py Tue Apr 1 15:22:04 2003
@@ -192,4 +192,6 @@
writer = ResolvedObjectWriter()
obj = ResolvedObjectAdapter(get_self(resolve), resolved)
- return writer.getState(obj)
+ state = writer.getState(obj)
+ writer.close()
+ return state
=== Zope3/src/zodb/connection.py 1.25 => 1.26 ===
--- Zope3/src/zodb/connection.py:1.25 Thu Mar 20 19:34:08 2003
+++ Zope3/src/zodb/connection.py Tue Apr 1 15:22:04 2003
@@ -445,9 +445,11 @@
return
writer = ObjectWriter(self)
- for o in writer.newObjects(obj):
- self._commit_store(writer, o, transaction)
- writer.close()
+ try:
+ for o in writer.newObjects(obj):
+ self._commit_store(writer, o, transaction)
+ finally:
+ writer.close()
def _commit_store(self, writer, obj, transaction):
oid = obj._p_oid
=== Zope3/src/zodb/export.py 1.6 => 1.7 ===
--- Zope3/src/zodb/export.py:1.6 Thu Mar 13 17:11:34 2003
+++ Zope3/src/zodb/export.py Tue Apr 1 15:22:04 2003
@@ -129,3 +129,5 @@
data, refs = copier.copy(p)
self._storage.store(newObjectId, None, data, refs,
self._version, txn)
+
+ copier.close()
=== Zope3/src/zodb/serialize.py 1.18 => 1.19 ===
--- Zope3/src/zodb/serialize.py:1.18 Tue Apr 1 15:15:28 2003
+++ Zope3/src/zodb/serialize.py Tue Apr 1 15:22:04 2003
@@ -327,6 +327,9 @@
self._reader = CopyObjectReader(storage, created, self.oids)
self._writer = CopyObjectWriter(jar)
+ def close(self):
+ self._writer.close()
+
def copy(self, pickle):
classmeta, state = self._reader.readPickle(pickle)
data = self._writer._dump(classmeta, state)