[Zope-Checkins] CVS: Zope/lib/python/Products/Transience/help - Transience-add.stx:1.5 Transience-change.stx:1.7 TransienceInterfaces.py:1.7

Chris McDonough chrism@zope.com
Wed, 21 Nov 2001 17:46:37 -0500


Update of /cvs-repository/Zope/lib/python/Products/Transience/help
In directory cvs.zope.org:/tmp/cvs-serv11583/help

Modified Files:
	Transience-add.stx Transience-change.stx 
	TransienceInterfaces.py 
Log Message:
Moved TransientObjects into their own module.

Removed wrap_with argument from new and new_or_existing methods
of Transient Data Containers.

Removed delete method of Transient Data Containers.

Added out-of-memory protection to Transient Data Containers.  A
  new __init__ value ('limit') is used to specify the max number
  of objects that can be contained within a transient data container.
  A new envvar ZSESSION_OBJECT_LIMIT can be used to control the
  limit of the default session_data TDC.  Also updated help and
  API docs with this change.

Added a new exception, MaxTransientObjectsExceeded, which is raised
  when the OOM protection kicks in.

Various implementation changes including the use of a BTrees Length
  object to store Transient Data Container length info as well
  as improvements to how buckets are expired.

Addition of tests for OOM protection fatures.



=== Zope/lib/python/Products/Transience/help/Transience-add.stx 1.4 => 1.5 ===
        A setting of "0" indicates that objects should not expire.
 
+     - **Maximum number of subobjects **
+
+       The maximum number of subobjects that this container may
+       simultaneously hold.
+
+       If the value is "0", the number of objects addable to the container
+       will be not be artificially limited.
+
+       Note: This setting is useful to prevent accidental or deliberate denial
+       of service due to RAM shortage if the transient object container is
+       instantiated in a storage which is backed solely by RAM, such
+       as a Temporary Folder.
+
      - **Script to call when objects are added**
 
        *Optional*


=== Zope/lib/python/Products/Transience/help/Transience-change.stx 1.6 => 1.7 ===
        If the timeout value is "0", objects will not time out.
 
+     - **Maximum number of subobjects **
+
+       The maximum number of subobjects that this container may
+       simultaneously hold.
+
+       If the value is "0", the number of objects addable to the container
+       will be not be artificially limited.
+
+       This setting is useful to prevent accidental or deliberate denial
+       of service due to RAM shortage if the transient object container is
+       instantiated in a storage which is backed solely by RAM, such
+       as a Temporary Folder.
+
      - **Script to call when objects are added**
 
        *Optional*


=== Zope/lib/python/Products/Transience/help/TransienceInterfaces.py 1.6 => 1.7 ===
         """
 
-    def delete(self, k):
-        """
-        Delete value associated with key k, raise a KeyError if nonexistent.
-
-        Permission -- 'Access Transient Objects'
-        """
-
     def new(self, k):
         """
         Creates a new subobject of the type supported by this container
@@ -129,6 +122,9 @@
 
         "k" must be a string, else a TypeError is raised.
 
+        If the container is 'full', a MaxTransientObjectsExceeded will
+        be raised.
+
         Permission -- 'Create Transient Objects'
         """
 
@@ -142,6 +138,9 @@
 
         "k" must be a string, else a TypeError is raised.
 
+        If the container is 'full', a MaxTransientObjectsExceeded exception
+        be raised.
+
         Permission -- 'Create Transient Objects'
         """
     
@@ -345,6 +344,16 @@
         Permission -- Always available
         """
 
+class MaxTransientObjectsExceeded:
+    """
+    An exception importable from the Products.Transience.Transience module
+    which is raised when an attempt is made to add an item to a
+    TransientObjectContainer that is 'full'.
 
+    This exception may be caught in PythonScripts through a normal import.
+    A successful import of the exception can be achieved via::
+
+      from Products.Transience import MaxTransientObjectsExceeded
+    """