[Zodb-checkins] SVN: ZODB/branches/3.3/src/persistent/interfaces.py Merge revs 28249 and 28250 from trunk.

Tim Peters tim.one at comcast.net
Tue Oct 26 11:54:56 EDT 2004


Log message for revision 28251:
  Merge revs 28249 and 28250 from trunk.
  
  Document _p_invalidate().
  

Changed:
  U   ZODB/branches/3.3/src/persistent/interfaces.py

-=-
Modified: ZODB/branches/3.3/src/persistent/interfaces.py
===================================================================
--- ZODB/branches/3.3/src/persistent/interfaces.py	2004-10-26 15:52:54 UTC (rev 28250)
+++ ZODB/branches/3.3/src/persistent/interfaces.py	2004-10-26 15:54:56 UTC (rev 28251)
@@ -149,7 +149,8 @@
           - call _p_deactivate()
           - set _p_changed to None
 
-    There is one way to invalidate an object:  delete its _p_changed
+    There are two ways to invalidate an object:  call the
+    _p_invalidate() method (preferred) or delete its _p_changed
     attribute.  This cannot be ignored, and is used when semantics
     require invalidation.  Normally, an invalidated object transitions
     to the ghost state.  However, some objects cannot be ghosts.  When
@@ -235,6 +236,15 @@
         may choose to keep an object in the saved state.
         """
 
+    def _p_invalidate():
+        """Invalidate the object.
+
+        Invalidate the object.  This causes any data to be thrown
+        away, even if the object is in the changed state.  The object
+        is moved to the ghost state; further accesses will cause
+        object data to be reloaded.
+        """
+
 class IPersistentNoReadConflicts(IPersistent):
     def _p_independent():
         """Hook for subclasses to prevent read conflict errors.



More information about the Zodb-checkins mailing list