[ZODB-Dev] Savepoints are invalidated once they are used
Tim Peters
tim at zope.com
Mon Jul 11 17:27:17 EDT 2005
[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).
More information about the ZODB-Dev
mailing list