RAM Cache Manager doesn't work for my script
Hi, all 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. Thanks, -- -tick
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
Dieter Maurer wrote:
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.
Thanks a lot for the good explanation. That's excactly what i needed. -- -tick
participants (2)
-
Dieter Maurer -
Vital Lobachevsky