[DB-SIG] Two-phase commit API proposal (was Re: Any standard for two phase commit APIs?)
Stuart Bishop
stuart at stuartbishop.net
Tue Jan 22 09:48:50 CET 2008
James Henstridge wrote:
> 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'm happy with the design.
I personally don't think we should use the xa prefix, as this will make
people think that this is an XA interface when it isn't - an XA like API
would be something built on top of this.
I would think the following would be better names:
con.begin_prepared(xid=None)
con.prepare_transaction()
con.rollback_prepared(xid=None)
con.commit_prepared(xid=None)
con.list_prepared()
> 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.
It seems that the formatID is unnecessary and just a requirement of the XA C
interface. Also, the xid() method you propose should be camelcase to match
the other type constructors, so Xid(gtrid, bqual=None) or
TransactionId(gtrid, bqual=None). If the xa_recover/list_prepared method
returns TransactionId objects they can contain platform specific information
too which is great (username, prepared timestamp & database for PostgreSQL
for instance).
--
Stuart Bishop <stuart at stuartbishop.net>
http://www.stuartbishop.net/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: OpenPGP digital signature
Url : http://mail.python.org/pipermail/db-sig/attachments/20080122/76ccc0ca/attachment.pgp
More information about the DB-SIG
mailing list