[Zope] A ZODB storage and Undo machinery issue

Oliver Bleutgen myzope@gmx.net
Fri, 10 Jan 2003 16:26:57 +0100


Ausum Studio wrote:
> ProductX I'm writing performs the following routine every time an object's
> management page is viewed: It checks whether the object's url is already
> stored at a record in ProductX object, and also assigns a new hits number
> for that record. This means that every time I view a page in the ZMI, a
> store procedure is called. (Caller is somewhere on the manage_tabs dtml
> file.)
> 
> My problem is how to avoid that after a simple view of a page (and
> comsecuently a storage procedure is performed) the Undo machinery considers
> the current view method as a valid transactioned object. As an example,
> just by opening the Properties management window one time and another, the
> manage_propertiesForm dtml method appears -in the Undo page- as a valid
> transaction in the current pile, as many times as we have clicked the link,
> thus disturbing the whole undo machinery. (No undo will work at all).
> 
> I'm writing a simple aid for the ZMI, but the need to perform a storage
> procedure like this (universal and site-wide) is also shared by people
> wanting to perform and show live site stats.
> 
> Could anyone point me in the right direction? How to avoid the recording of
> any particular transaction? 

Use an external method and write the hits to a file - maybe by 
unpickling - changing - pickling a dictionary of urls?

cheers,
oliver