[Sidnei da Silva]
> We've hit a case where loadBefore would get called on TmpStore during
> plone.org migration.
>
> Unfortunately TmpStore doesn't implement loadBefore. There seems to be no
> tests for this. I tried to write one and provide a fix but just occurred
> me that TmpStore tries to be a 'simpler FileStorage that mixes with the
> current storage'.

This was fixed a few weeks, in rev 30825:

    http://svn.zope.org/ZODB/branches/3.4/?rev=30825&view=rev

If you don't care too much about the new test, it's just a matter of adding
the string "loadBefore" to this list in TmpStore.__init__:

        for method in (
            'getName', 'new_oid', 'modifiedInVersion', 'getSize',
            'undoLog', 'versionEmpty', 'sortKey', 'loadBefore',
            ):
            setattr(self, method, getattr(storage, method))

> Wouldn't it be simpler to make TmpStore subclass from FileStorage

No, because TmpStore is used by Connection (to support savepoints), and
Connection can't make assumptions about the _kind_ of storage in use.

> and just delegate to the current storage where appropriate?

Right, that's the purpose of the loop above.

_______________________________________________
For more information about ZODB, see the ZODB Wiki:
http://www.zope.org/Wikis/ZODB/

ZODB-Dev mailing list  -  ZODB-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zodb-dev

Reply via email to