[Zope3-dev] Re: [ZODB-Dev] revise transaction API
Jeremy Hylton
jeremy at alum.mit.edu
Mon Jun 14 08:01:25 EDT 2004
On Sat, 2004-06-12 at 11:42, Christian Robottom Reis wrote:
> > > 3. getting all modified objects (inclusing those in subtransactions).
> >
> > What would this be used for? This is pretty hard to do for RDBMSs and
> > other psuedo transactional things, like LDAP connections and mail
> > systems.
>
> In one of our systems, I "earmark" all objects changed with an easily
> queryable "last_changed_time" attribute. It's a lot easier to do this on
> "the way out" than to wire up __setattr__s on all the objects involved.
>
> The other reason is for simple debugging -- sometimes when looking at a
> process that does many changes, it's interesting to see how much of the
> database has been touched. I've used this to study the indexing
> mechanics in IC, and also when trying to find out at what point certain
> objects were modified.
I think this reason alone makes it worthwhile. ZODB can be a bit
mysterious at first. I've seen many people ask, "When I commit
transaction X, what objects get saved?" An explicit call -- say
transaction.get().modified() -- would make the answer unambigious, even
if it wasn't always obvious why the objects were modified.
Jeremy
More information about the ZODB-Dev
mailing list