[Zope] RAM Cache Manager doesn't work for my script

Dieter Maurer dieter at handshake.de
Fri Oct 1 15:01:03 EDT 2004


Vital Lobachevsky wrote at 2004-10-1 16:01 +0300:
>I'm trying to use RAM Cache Manager to cache a Python Script object. The 
>script is pretty simple. Just a call of a  SQL Method and some logic. I've 
>made this script cacheable using "Cache" tab, ran this script several time. 
>Then went to "Statistics" tab of Cache Manager. But the cache doesn't work -- 
>I see only zeros opposite my script. What's wrong? How to get the cache 
>working in this case. Any help greatly appreciated.

The RAM cache manager can only cache picklable objects.
The result of Z SQL Methods is not picklable.

Most DAs support a "dictionaries" method (available via result objects)
which converts a Z SQL Method result into a standard dictionary.
These dictionaries would be picklable.

"ZODBCDA" is an example that does not (but you should not use it, for
other reasons, too).


When you are interested in Z SQL Method result caching,
then you may want to look at their "Advanced" tab.
You can enable caching there (on the level of the Z SQL Method
itself).

-- 
Dieter


More information about the Zope mailing list