[Zope-CVS] CVS: Products/AdaptableStorage/zodb - ASConnection.py:1.13

Shane Hathaway shane@zope.com
Mon, 6 Jan 2003 11:12:31 -0500


Update of /cvs-repository/Products/AdaptableStorage/zodb
In directory cvs.zope.org:/tmp/cvs-serv5256/zodb

Modified Files:
	ASConnection.py 
Log Message:
Added assertions that verify unmanaged objects don't get mixed up with
managed objects.


=== Products/AdaptableStorage/zodb/ASConnection.py 1.12 => 1.13 ===
--- Products/AdaptableStorage/zodb/ASConnection.py:1.12	Tue Dec 31 16:47:52 2002
+++ Products/AdaptableStorage/zodb/ASConnection.py	Mon Jan  6 11:12:27 2003
@@ -144,6 +144,7 @@
                 apply(getattr(self, method_name), (transaction,) + args, kw)
             return
         oid=object._p_oid
+        assert oid != 'unmanaged', repr(object)
         #invalid=self._invalidated.get
         invalid = self._invalid
         if oid is None or object._p_jar is not self:
@@ -189,6 +190,7 @@
             object=stack[-1]
             del stack[-1]
             oid=object._p_oid
+            assert oid != 'unmanaged', repr(object)
             serial=getattr(object, '_p_serial', '\0\0\0\0\0\0\0\0')
             if serial == '\0\0\0\0\0\0\0\0':
                 # new object
@@ -393,6 +395,7 @@
         oid = object._p_oid
         if oid is None:
             return None
+        assert oid != 'unmanaged', repr(object)
         return self._db._oid_encoder.decode(oid)
 
     def newKey(self):