[Zope3-checkins] CVS: Zope3/src/zodb - connection.py:1.23 interfaces.py:1.17

Jeremy Hylton jeremy@zope.com
Thu, 20 Mar 2003 13:24:06 -0500


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

Modified Files:
	connection.py interfaces.py 
Log Message:
Update IConnection invalidate() doc string.


=== Zope3/src/zodb/connection.py 1.22 => 1.23 ===
--- Zope3/src/zodb/connection.py:1.22	Thu Mar 20 13:08:27 2003
+++ Zope3/src/zodb/connection.py	Thu Mar 20 13:24:05 2003
@@ -267,13 +267,6 @@
         self._cache.incrgc()
 
     def invalidate(self, oids):
-        """Invalidate a particular oid
-
-        This marks the oid as invalid, but doesn't actually invalidate
-        it.  The object data will be actually invalidated at certain
-        transaction boundaries.
-        """
-
         self._inv_lock.acquire()
         try:
             self._invalidated.update(oids)


=== Zope3/src/zodb/interfaces.py 1.16 => 1.17 ===
--- Zope3/src/zodb/interfaces.py:1.16	Thu Mar 13 17:11:34 2003
+++ Zope3/src/zodb/interfaces.py	Thu Mar 20 13:24:05 2003
@@ -228,13 +228,23 @@
 class InvalidObjectReference(POSError):
     """An object contains an invalid reference to another object.
 
-    An invalid reference may be one of:
+    A reference is invalid if it refers to an object managed
+    by a different database connection.
 
-    o A reference to a wrapped persistent object.
-
-    o A reference to an object in a different database connection.
+    Attributes:
+    obj is the invalid object
+    jar is the manager that attempted to store it.
+    
+    obj._p_jar != jar
     """
 
+    def __init__(self, obj, jar):
+        self.obj = obj
+        self.jar = jar
+
+    def __str__(self):
+        return "Invalid reference to object %s." % _fmt_oid(self.obj._p_jar)
+    
 class IAppDatabase(Interface):
     """Interface exported by database to applications.
 
@@ -314,19 +324,19 @@
     The Connection also implements IPersistentDataManager.
     """
 
+    def invalidate(oids):
+        """Invalidate a set of oids modified by a single transaction.
+
+        This marks the oids as invalid, but doesn't actually
+        invalidate them.  The object data will be actually invalidated
+        at certain transaction boundaries.
+        """
+
     def reset(version=""):
         """Reset connection to use specified version."""
 
     def getVersion():
         """Return the version that connection is using."""
-
-    def invalidate(oid):
-        """Invalidate a particular oid
-
-        This marks the oid as invalid, but doesn't actually invalidate
-        it.  The object data will be actually invalidated at certain
-        transaction boundaries.
-        """
 
     def close():
         pass