[DB-SIG] Two-phase commit API proposal (was Re: Any standard for two phase commit APIs?)
James Henstridge
james at jamesh.id.au
Mon Jan 21 13:12:17 CET 2008
On 21/01/2008, Federico Di Gregorio <fog at initd.org> 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.
James.
More information about the DB-SIG
mailing list