[Zope-dev] two-phase-commit question

Steve Alexander steve@cat-box.net
Sat, 30 Sep 2000 08:41:59 +0100


Kapil Thangavelu wrote:

> ZOPE_HOME/lib/python/Shared/DC/ZRDB/TM.py
> 
> Glancing over the Transaction TM mixin class... i noticed a line
> commit=tpc_abort=tpc_begin
> 
> i can understand tpc_begin=commit, but the abort seems strange. 
> if an abort happens in the two phase commit the equality doesn't 
> make sense to me.
> 
> whats going on here? Is this meant to be overidden?

Yes. Override the methods that you need to. The rest are given a 
no-operation default implementation.

The class more or less defines an interface.

def tpc_begin(self, *ignored): pass
commit=tpc_abort=tpc_begin

The assignment you see is just a short-hand way of saying that commit, 
tpc_abort and tpc_begin have the same method signature and the same 
implementation


--
Steve Alexander
Software Engineer
Cat-Box limited
http://www.cat-box.net