James Henstridge wrote at 2008-1-21 14:00 +0900: >On 19/01/2008, Dieter Maurer <[EMAIL PROTECTED]> wrote: >> It does this indeed. >> >> And it assumes that a resource manager accepts a vote only >> when it can garantee that the subsequent "commit" will succeed (and >> does not fail). >> >> A resource manager needs to expose both a "vote" (with the above garantee) >> and a "commit" in order to be a first class participant of >> Zope's transaction system. >> >> Relational database interfaces often lack the equivalent of a "vote". > >I'd disagree with this description. From the Zope transaction >documentation, the order of methods is: > > tpc_begin commit tpc_vote (tpc_finish | tpc_abort) > >>From the descriptions of the various methods, a database adapter >supporting 2PC would prepare the transaction at commit(), and commit >or rollback that transaction in tpc_finish or tpc_abort respectively. > >After preparing the transaction, the transaction should be committable >under normal circumstances, so it would have no reason to vote no as >part of tpc_vote(). > >I disagree that the lack of a tpc_vote() method makes the database >adapter a second class citizen: it simply reflects the fact that the >adapter makes up its mind at the commit() stage independent of what >other data managers do.
I agree with you. The distinction between "commit" and "vote" is probably only for historical reasons: Formerly, "objects" registered with the transaction, not resource managers. In the "commit", the registered objects where individually committed, then the "resource managers" where asked for their vote. Nowadays, resource manager register with the transaction and we can freely move functions between "commit" and "vote". What should be clear: despite its name "commit" is not a true commit, neither is "commit" followed by "vote". Both together need to prepare the commit which must eventually succeed when "finish" is called. -- Dieter _______________________________________________ DB-SIG maillist - DB-SIG@python.org http://mail.python.org/mailman/listinfo/db-sig