[TransWarp] problem with commit and activated query-link
Phillip J. Eby
pje at telecommunity.com
Tue Feb 18 16:48:38 EST 2003
At 01:06 PM 2/18/03 +0100, Ulrich Eck wrote:
>Traceback (most recent call last):
> File "<stdin>", line 1, in ?
> File "/usr/lib/python2.2/site-packages/peak/storage/transactions.py",
> line 20, in commitTransaction
> getTransaction(subject).commit()
> File "/usr/lib/python2.2/site-packages/peak/storage/transactions.py",
> line 223, in commit
> self._prepare()
> File "/usr/lib/python2.2/site-packages/peak/storage/transactions.py",
> line 183, in _prepare
> unready = [p for p in state.participants if not p.readyToVote(self)]
> File "/usr/lib/python2.2/site-packages/peak/storage/data_managers.py",
> line 498, in readyToVote
> self.flush()
> File "/usr/lib/python2.2/site-packages/peak/storage/data_managers.py",
> line 444, in flush
> del dirty[key]
>KeyError: 137744044
>
>this probably happens because flush is called when oidFor and readyToVote
>is called.
>the flush in oidFor already clears the dirty-flag, and the flush in
>readyToVote seems
>not to get this right (dirty.values() seem to do something wrong in this
>case).
>
>would a simple condition in flush():
>
>if key in dirty:
> del dirty[key]
>
>solve the problem (objects might have been saved twice in this case)
>or is it a problem with my implementation?
Nope, it's a problem with *my* implementation. :) You're right, this part
of flush() is not re-entrance safe, and your proposed change should fix it.
More information about the PEAK
mailing list