[Zope-Checkins] CVS: Zope3/lib/python/ZODB - Connection.py:1.69

Shane Hathaway shane@cvs.zope.org
Wed, 19 Jun 2002 23:54:51 -0400


Update of /cvs-repository/Zope3/lib/python/ZODB
In directory cvs.zope.org:/tmp/cvs-serv10086

Modified Files:
	Connection.py 
Log Message:
weeping, wailing, and gnashing of teeth may follow...


=== Zope3/lib/python/ZODB/Connection.py 1.68 => 1.69 ===
     re-created as the connections are reopened.
     """
+    # WARNING: It is only safe to call this method if the application
+    # never keeps references to ZODB objects after the connection is
+    # closed.  If this rule is violated, ZODB will load inconsistent
+    # duplicates of those objects and you may see silent corruption.
     global _cache_timestamp
     _cache_timestamp = time.time()
 
@@ -338,6 +342,12 @@
 
     def _resetCache(self):
         "Creates a new cache, discarding the old."
+        # WARNING: This method is not part of the public API!
+        # If you call this method when anything besides the
+        # cache has references to ZODB objects, ZODB will start loading
+        # inconsistent duplicates of the objects, leading to silent
+        # corruption and gnashing of teeth.  And don't call this method
+        # while objects are pending in the transaction queue.  Ouch.
         self._cache_timestamp = _cache_timestamp
         self._invalidated.clear()
         orig_cache = self._cache