On 2008-01-21 13:12, James Henstridge wrote:
> On 21/01/2008, Federico Di Gregorio <[EMAIL PROTECTED]> wrote:
>>> Perhaps an argument to xa_commit() would be appropriate here?
>>>
>>>     connection.xa_commit(onephase=True)
>>>
>>> Without the argument, the commit would be considered to be a
>>> ProgrammingError.  That would reduce the chance of programmer error
>>> leading to data corruption.
>> Lets not make an API that has features useful on a single backend. I
>> suppose the necessity for a one-phase commit in a two-phase transaction
>> is rare. A simple API means early adoption by most of the adapters.
> 
> Well, Postgres lets you commit a 2PC transaction before preparing it
> too (after all, it doesn't know you are using 2PC until you prepare).
> 
> Judging by the kinterbasdb and cx_Oracle code, they can do so as well.
>  This isn't just a "single backend" feature.

Mixing one-phase and two-phase commits sounds like mixing two
concepts that don't belong together, IMHO.

It would be too easy for an application to issue a .commit()
somewhere and thereby breaking the whole two phase commit
idea.

I'd rather like to see the two concepts well separated and
exceptions raised if you try to mix them.

After all, you could still open a second connection if you
need one phase transactions for some other purpose.

-- 
Marc-Andre Lemburg
eGenix.com

Professional Python Services directly from the Source  (#1, Jan 21 2008)
>>> Python/Zope Consulting and Support ...        http://www.egenix.com/
>>> mxODBC.Zope.Database.Adapter ...             http://zope.egenix.com/
>>> mxODBC, mxDateTime, mxTextTools ...        http://python.egenix.com/
________________________________________________________________________

:::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,MacOSX for free ! ::::


   eGenix.com Software, Skills and Services GmbH  Pastor-Loeh-Str.48
    D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg
           Registered at Amtsgericht Duesseldorf: HRB 46611
_______________________________________________
DB-SIG maillist  -  DB-SIG@python.org
http://mail.python.org/mailman/listinfo/db-sig

Reply via email to