On Tue, May 11, 2010 at 7:34 AM, Jim Fulton <[email protected]> wrote:
> [...] The best I've been
> able to come up with is something like:
>
> t = ZODB.transaction(3)
> while t.trying:
> with t:
> ... transaction body ...
I think you could get this to work:
for transaction in ZODB.retries(3):
with transaction:
... transaction body ...
ZODB.retries would return an iterator that would raise StopIteration on
the next go-round if the previously yielded context manager exited
without a ConflictError.
--
Benji York
_______________________________________________
For more information about ZODB, see the ZODB Wiki:
http://www.zope.org/Wikis/ZODB/
ZODB-Dev mailing list - [email protected]
https://mail.zope.org/mailman/listinfo/zodb-dev