[ZODB-Dev] Savepoints are invalidated once they are used
Jeremy Hylton
jhylton at gmail.com
Mon Jul 11 21:37:31 EDT 2005
IIRC, the old implementation of savepoints kept a copy of the index at
the time the savepoint was taken so that you could rollback to it
multiple times. I don't think there's any way to avoid such a copy.
Jeremy
On 7/11/05, Tim Peters <tim at zope.com> wrote:
> [Tim Peters]
> > ...
> > The good news is that, while it was hard to find, it's a one-line repair.
>
> Alas, that wasn't the end of it either. I think I'm at the end now, and all
> the tests are passing again (including new tests to provoke new problems I
> found).
>
> A savepoint (of the data manager Connection flavor) remembers the TmpStore
> index at the time the savepoint was made. When a savepoint could be used
> only once, the savepoint only needed to make sure it had a copy of the index
> at the time the savepoint was _made_. But when a savepoint can be reused,
> even the TmpStore.reset() line
>
> self.index = index
>
> was a source of subtle bugs (later mutations to `self.index` showed up in
> `index` too, and `index` there is typically taken from a savepoint's "this
> is what the world looked like when I was new" state -- mutating that was
> harmless before because the rollback could never be used again, but became
> disastrous when allowing re-use).
>
> _______________________________________________
> For more information about ZODB, see the ZODB Wiki:
> http://www.zope.org/Wikis/ZODB/
>
> ZODB-Dev mailing list - ZODB-Dev at zope.org
> http://mail.zope.org/mailman/listinfo/zodb-dev
>
More information about the ZODB-Dev
mailing list