Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
7519fa30
Commit
7519fa30
authored
Nov 15, 2001
by
matt@zope.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove Transience.stx file
parent
3fd48d78
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
2 additions
and
88 deletions
+2
-88
lib/python/Products/Transience/help/Transience-add.stx
lib/python/Products/Transience/help/Transience-add.stx
+1
-2
lib/python/Products/Transience/help/Transience-change.stx
lib/python/Products/Transience/help/Transience-change.stx
+1
-2
lib/python/Products/Transience/help/Transience.stx
lib/python/Products/Transience/help/Transience.stx
+0
-84
No files found.
lib/python/Products/Transience/help/Transience-add.stx
View file @
7519fa30
...
...
@@ -48,6 +48,5 @@ TransientObjectContainer - Add
See Also
- "Transient Objects":Transience.stx
- "Transience API":TransienceInterfaces.py
lib/python/Products/Transience/help/Transience-change.stx
View file @
7519fa30
...
...
@@ -56,6 +56,5 @@ TransientObjectContainer - Manage
See Also
- "Transient Objects":Transience.stx
- "Transience API":TransienceInterfaces.py
lib/python/Products/Transience/help/Transience.stx
deleted
100644 → 0
View file @
3fd48d78
Transient Objects
A transient object is an object which persists for a limited
period of time after which it is automatically expired. The
objects which make this behavior possible are
TransientObjectContainers and TransientObjects.
Transient Object Container Overview
To facilitate persistence of items for a limited duration, a
TransientObjectContainer is a container which stores and maintains
an expiration policy related to TransientObjects.
A TransientObjectContainer flushes expired entries based on a
timeout based on last access of a contained key. It also has a
notification mechanism whereby it can notify a script or method
that an object has been added or removed from the container. When
a new item is created, the add notification target on the
container is called. Similarly, when the item is deleted, either
explicitly or by timeout, the delete notification target is
called.
One uses the 'new_or_existing' or 'new' methods of a
TransientObjectContainer to obtain a TransientObject. The
TransientObjectContainer only accepts string keys to name objects;
you may not use objects as keys.
A Transient Object is considered "expired" by a
TransientObjectContainer when it has not been accessed in a
configurable number of minutes (the "data object timeout").
Using Transient Objects
TransientObjects are themselves "containerish" and
"dictionary-like"; they implement a dictionary-like interface as
well as methods related to manual invalidation, timeout, and
introspection.
The values of a transient object can be any pickleable Python data
structure while the keys of a transient object may be any hashable
and pickleable Python data structure.
Note that TransientObjects do not offer the contract of "normal"
ZODB container objects; mutations made to items which are
contained within a TransientObject cannot be expected to persist.
Developers need explicitly resave the state of a subobject of a
TransientObject by placing it back into the TransientObject via
the TransientObject.__setitem__ or .set methods. This requirement
is due to the desire to allow people to create alternate
TransientObject implementations that are *not* based on the ZODB.
Practically, this means that when working with a TransientObject
which contains mutable subobjects (even if they inherit from
Persistence.Persistent), you *must* resave them back into the
TransientObject. For example::
class Foo(Persistence.Persistent):
pass
transient_object = transient_data_container.new('t')
foo = transient_object['foo'] = Foo()
foo.bar = 1
# the following is *necessary* to repersist the data
transient_object['foo'] = foo
Notifications
Transient Object Containers support notification targets; these
represent objecs in Zope which are called when the transient object
container adds or deletes a transient object.
The notification target is called as the "Anonymous User," 'nobody.'
If the notification target requires special permissions, add proxy roles
to the notification target object. The notification target is ALWAYS
callable by the Transient Object Container, so no users in Zope need
to be able to access them directly if they contain secure functions.
Thus, if the target object performs sensitive information, it may be
protected with the security machinery, by restricting what roles may
access it, and granting it proxy roles to access other objects, and
the notification process will drop permissions to 'nobody' when
invoking the target.
See Also
- "Transient Object API":TransienceInterfaces.py
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment