[Zope3-checkins] CVS: Zope3/src/zodb - connection.py:1.38

Albertas Agejevas alga at pov.lt
Thu Oct 9 14:05:29 EDT 2003


Update of /cvs-repository/Zope3/src/zodb
In directory cvs.zope.org:/tmp/cvs-serv3595

Modified Files:
	connection.py 
Log Message:
Fixes to Connection.add:
  * register the added object in _cache, so we can get(oid) it
  * register the object in _created, so it is dis-owned on abort.


=== Zope3/src/zodb/connection.py 1.37 => 1.38 ===
--- Zope3/src/zodb/connection.py:1.37	Wed Oct  8 04:20:28 2003
+++ Zope3/src/zodb/connection.py	Thu Oct  9 14:04:58 2003
@@ -308,6 +308,14 @@
             obj._p_jar = self
             obj._p_oid = self.newObjectId()
             obj._p_changed = True
+            self._created.add(obj._p_oid)
+
+            # There is an 'invariant' that objects in the cache can be
+            # made into ghosts because they have _p_jar and _p_oid.
+            # We are breaking this invariant, but that's OK because
+            # it's not used anywhere.  The right solution is to have a
+            # separate cache of objects outside that invariant.
+            self._cache.set(obj._p_oid, obj)
 
 
     ######################################################################




More information about the Zope3-Checkins mailing list