[ZODB-Dev] Clearing sticky RCEs after a transaction abort
Dieter Maurer
dieter at handshake.de
Fri Sep 17 15:57:40 EDT 2004
Tim Peters wrote at 2004-9-16 17:29 -0400:
> ...
>[Dieter Maurer]
>> That's why I have put (in our private copy of "Connection.py")
>> "flush_invalidation" calls in "_setDB"
>
>ZC's Connection._setDB() also calls _flush_invalidations() (assuming that's
>what "flush_invalidation" meant).
>
>> and the "abort" code when the connection itself has registered.
>>
>> def abort(self, object, transaction):
>> ...
>> if object is self:
>> # Note: when a transaction with subtransactions is aborted
>> # "self._tmp is None" will be false.
>> # However, this should not be a serious problem
>> self._flush_invalidations(self._tmp is None)
>
>Maybe you can explain this: what good is the "if object is self" branch?
The main purpose to register the connection with the
transaction has been the "onCommitAction". Apparently,
this is a mechanism to get some methods called during commit.
It could have been done with a different transaction client
(or observer as Kapil named it) but it was solved in this way.
For my MVCC implementation, I needed a reliable way that
"flush_invalidations" is called when the transaction is aborted.
Therefore, I force the connection to always register with the transaction.
I think, that your MVCC implementation will need something like that, too.
--
Dieter
More information about the ZODB-Dev
mailing list