[Zope] Storing an object in RAM during Zope's up-time

Pavlos Christoforou pavlos@gaaros.com
Mon, 3 Apr 2000 11:56:34 -0400 (EDT)


On Fri, 31 Mar 2000, Hung Jung Lu wrote:

> Hi,
> 
> How do I store an object in RAM during Zope's up-time?
> 
> I don't want to store it as a persistent object.
> And I don't want it to disappear after a http transaction
> (so REQUEST variable is no good.)
> 
> I would like to be able to create this object given
> a particular http transaction, and afterward I may
> want to modify it. This is a bit like session management
> data, but it's a piece of data that is shared by all
> sessions...
> 
> regards,
> 

One approach is to add a mutable object, a dictionary for example, on some
Zope object (or create a special one for the purpose) and use it mutably.
In this way you won't trigger ZODB but you must take care of cleaning up.
Or store the data in an attribute begining with _v_. In both cases the
data will be lost after the object is deactivated. With frequently used
objects this won't be a problem.

Pavlos