[ZODB-Dev] Re: [Zope-Checkins] CVS: ZODB3/ZODB - FileStorage.py:1.126

Barry A. Warsaw barry@wooz.org
Wed, 5 Feb 2003 17:16:25 -0500


>>>>> "TD" == Toby Dickenson <tdickenson@geminidataloggers.com> writes:

    TD> Interesting. I have often thought that the
    TD> copyTransactionsFrom() functionality is out of place; that it
    TD> would be better to have a copyTransactionsTo() method on the
    TD> partner storage.

That might be interesting to debate for ZODB4, but I still think I
like copyTransactionsFrom() better.

    TD> A copyTransactionsTo() method would have to use the restore()
    TD> method of its partner. That seems better than a
    TD> copyTransactionsFrom() that has to use its partner's
    TD> iterator(). restore() is better defined and more
    TD> understandable, not least because it is so similar to store().

copyTransactionsFrom() uses restore() if the target storage has such a
method, otherwise it uses store().  So functionally the two
implementations would probably be very similar for storages like
FileStorage or BDBFullStorage.

OTOH, it seems more natural to pull transactions from somewhere else
that to push them into a storage, but I'm not sure I feel strongly
about it.  6 one way, 1/2 dozen the other.

    TD> Are there any storages that dont implement restore()?

Non-versioning storages like BDBMinimalStorage and MappingStorage
don't.  But then, they don't implement iterators either, so it's
probably not much of a loss.

-Barry