Re: XA - Mailing list pgsql-advocacy

From Leonard Soetedjo
Subject Re: XA
Date
Msg-id 1128135524.3261.17.camel@leonard.stelar.com
Whole thread Raw
In response to Re: XA  (Chris Browne <cbbrowne@acm.org>)
List pgsql-advocacy
Hi,

I don't know whether this is the right list to clarify about 2PC & XA,
but here goes...

On Fri, 2005-09-30 at 14:42 -0400, Chris Browne wrote:
> simon@2ndquadrant.com (Simon Riggs) writes:
>
> > On Tue, 2005-09-27 at 23:10 -0400, Chris Browne wrote:
> >> josh@agliodbs.com (Josh Berkus) writes:
> >> > Chris,
> >> >
> >> >> Two phase commit is a prerequisite for doing distributed transactions,
> >> >> and XA is a particular standard to which the 2PC support does not, at
> >> >> this point, conform.
> >> >
> >> > Eh?  I was under the impression that XA was implemented in the JDBC
> >> > layer, not in the backend.
> >>
> >> There was an JDBC-based *attempt* at an XA handler; it wasn't fully
> >> functional, which essentially means it wasn't really XA.
> >>
> >> When the 2PC discussion was going on, it definitely came up in the
> >> discussion that this was a prerequisite to doing XA properly.  It
> >> might not be forcibly necessary in the strictest sense, but 2PC is
> >> certainly one of the normal means for synchronizing distributed
> >> transactions...
> >
> > I didn't realise that the 2PC we have implemented was not XA.
> >
> > That's bad news. To most people they are the same thing, so I foresee
> > some fairly poor feedback.
>
> That seems somewhat silly.
>
> XA is a Well Defined thing that is a whole lot more than just two
> phase commit.
>
> <http://www.opengroup.org/public/pubs/catalog/c193.htm>
>
> It is an API specified by an Open Group standard with a 12 function
> call API.
>
> Why anyone should _assume_ that something being called 2PC conforms to
> a standard with a particular name that isn't being named seems a bit
> mystifying.

I admit my knowledge of database is not very deep, and I thought that
2PC and XA is about the same thing.  But I guess there are many people
having the same thinking as me.

In where I live (Singapore), PostgreSQL is almost unheard of, and I'm
tired of people promoting MySQL for everything from simple website to
full blown ERP system.  Naturally, when I see that MySQL 5.0 is going to
have XA, I'd check out PostgreSQL to see  whether it has distributed
transaction too.  When I see that it has 2PC, I thought it's the same as
XA.

I still don't quite understand the whole thing.  Correct me if I'm
wrong: 2PC is a distributed transaction and a subset of XA's
functionality.  And XA is a standard that is mainly used by Java?  Does
this mean that Java JDBC/JTA can't do a distributed transaction with
postgreSQL for now?

Thanks :)


pgsql-advocacy by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: Time to start the PR machine
Next
From: Simon Riggs
Date:
Subject: Re: Next version: putting the pedal down