Re: [ZODB-Dev] ZODB growing / What triggers a transac tion? (Geändert von jdb30570@gmx.net)

Jeremy Hylton jhylton at gmail.com
Tue Sep 21 17:09:54 EDT 2004


On Tue, 21 Sep 2004 22:48:58 +0200, jdb30570 at gmx.net <jdb30570 at gmx.net> wrote:
> The problem is: I have custom file and container classes derived from
> File and Folder. Each of these inherits from a class called 'UserAware'
> which implements user specific features, such as a list of recently
> visited items. Everytime a user hits such a container or file through
> the web the complete object (including parent objects) is copied in the
> database. I am aware of the fact that Persistent traps changes made to
> the object and SimpleItem implements the undo feature, but the curious
> thing is that calling index_html on these objects does not change their
> state nor do I manually flag them (_p_changed=1). The only changes I
> commit are those on the user object through methods of UserAware.

Can you clarify the question:

You say that everytime a user hits a container the complete object is
copied to the database, and you also say that calling index_html does
not change their state.  I think these two statements must be mutually
exclusive.  If the object gets saved in the database, something must
be marking it as changed.

If UserAware keeps a list of recently visited items and it changes
each time the item is viewed, won't that cause part of UserAware to
change each time?

As a rule, you should use different Persistent instances to store data
that changes at different rates.  If a list of recently used objects
changes frequently, it will conserve a lot of space if you store it
in, for example, a separate PersistentList.

Jeremy


More information about the ZODB-Dev mailing list