[ZODB-Dev] Replacing bobobase_modification_time
Casey Duncan
c.duncan@nlada.org
Tue, 8 Jan 2002 08:52:54 -0500
I am posting this here to get reactions here for something that we have been
discussing on zope-dev that pertains to the ZODB.
Dieter M. discovered that bobobase_modification_time (henceforth referred to
as b_m_t) is not always an accurate representation of an object's
modification time, especially when an object has been modified in a
transaction that has not been commited. This is a problem when doing things
like cataloging an object in the same transaction that it is modified.
I thought this issue created an opprotunity to solve two problems. The above
problem and the anachronistic b_m_t API itself, which is always good for a
laugh in Zope classes. The idea is to create a new method in PersistentExtra
"getModificationTime" which returns the actual modification time of an object
based on the time the change is registered if it has been changed and not
commited and then the last commit time if no change has been made. I also
propose we add a second method "getLastCommitTime" or some-such which behaves
the same as the current b_m_t method. At the same time we would deprecate
b_m_t.
Kapil Thangavelu prototyped a couple of ideas. I think his latest code is
simple and straighforward enough to be incorporated, although it does not yet
replace and deprecate b_m_t, which I think is important.
He posted sample code to zope-dev yesterday, here is a (rather long) link:
http://zope.nipltd.com/public/lists/dev-archive.nsf/0a8715d5f3c7b6a3802568c1006328f7/9dcad434e2a73f2680256b3a006abc37?OpenDocument
Thoughts anyone?
/---------------------------------------------------\
Casey Duncan, Sr. Web Developer
National Legal Aid and Defender Association
c.duncan@nlada.org
\---------------------------------------------------/