[ZODB-Dev] Storage API corner cases
Barry Warsaw
barry at zope.com
Tue May 27 16:54:13 EDT 2003
On Mon, 2003-05-26 at 04:16, Toby Dickenson wrote:
> Firstly, how should getSerial behave when the current revision of an object
> has had its creation undone? The implementation in BaseStorage suggests that
> this case will raise a KeyError, but both FileStorage and BDBFull replace
> this base class method with one that returns the id of the revision in which
> its creation was undone.
The interface isn't very helpful here. :) I think getSerial() probably
ought to raise a KeyError when called on an uncreated object.
> A comment in zeoVerify suggests that ZEO is assuming that a KeyError will be
> raised, but its implementation will work with either behavior.
Hmm.
> Is getSerial used anywhere else? Is there a reason to require the FileStorage
> behaviour, or should we document both behaviours as acceptable?
I don't think both behaviors should be allowed. We should pick one,
document it, add test cases, and fix the code.
> Secondly, there are differences between storages in the list of transaction
> returned from undoLog: FileStorage includes some transactions that can never
> be undone because the transaction includes an object for which no previous
> history exists. DirectoryStorage omit these.
The previous history is missing because of a pack, it's the first
creation of an object, or some other reason?
> This is no problem if undoLog is only used to populate an undo GUI, but could
> lead to problems if undoLog is used for introspection. Is this a problem for
> anyone?
-Barry
More information about the ZODB-Dev
mailing list