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

Toby Dickenson tdickenson@geminidataloggers.com
Wed, 5 Feb 2003 12:25:14 +0000


On Tuesday 04 February 2003 5:16 pm, Barry Warsaw wrote:

> Modified Files:
> =09FileStorage.py
> Log Message:
> FileIterator.iterator(): Add this so we can pass iterators to
> BaseStorage's copyTransactionsFrom() method's "other" argument.

> +    # This allows us to pass an iterator as the `other' argument to
> +    # copyTransactionsFrom() in BaseStorage.  The advantage here is th=
at
> we +    # can create the iterator manually, e.g. setting start and stop=
,
> and then +    # just let copyTransactionsFrom() do its thing.

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

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

Are there any storages that dont implement restore()?

--=20
Toby Dickenson
http://www.geminidataloggers.com/people/tdickenson