[DB-SIG] Two-phase commit API proposal (was Re: Any standard for two phase commit APIs?)
M.-A. Lemburg
mal at egenix.com
Tue Jan 22 11:34:54 CET 2008
On 2008-01-21 15:40, James Henstridge wrote:
> On 21/01/2008, James Henstridge <james at jamesh.id.au> wrote:
>> On 18/01/2008, James Henstridge <james at jamesh.id.au> wrote:
>>> So is there any recommendations for what a two-phase commit API should
>>> look like?
>> I did a bit of investigation into a few databases, and came up with a
>> proposal for an extension to the DB-API.
>
> Here is an updated version of the proposal. It removes the analysis
> of the different databases, and updates the proposed API to match what
> we've been discussing here.
>
> I've added a section about what the "xid" arguments to the various
> methods should look like. That could probably do with some more
> discussion as I am not too sure about it.
>
> I've also included support for transaction recovery in the form of an
> xa_recover() method and calling the xa_commit()/xa_rollback() methods
> with a transaction ID as an argument.
Thanks. I like it a lot, except for making the XID an object - this
always appears to be a string in all the backends you've checked and
also in the XA standard, so I'd go for a simple string instead of
an object (those are always lots of work to do at C level).
Regarding the "xa_" prefix, I'm not much attached to it, but since
the interface does indeed look a lot like the XA interface, why not
make that reference ?
It also makes it clear, that the interface
sits on top of the standard DB-API connection API and that those
methods form a unit.
Plus they are currently not in use by any DB-API module, so don't
interfere with existing APIs.
--
Marc-Andre Lemburg
eGenix.com
Professional Python Services directly from the Source (#1, Jan 22 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
More information about the DB-SIG
mailing list