Re: 2PC transaction id - Mailing list pgsql-hackers

From Oliver Jowett
Subject Re: 2PC transaction id
Date
Msg-id 42C5172F.6070909@opencloud.com
Whole thread Raw
In response to Re: 2PC transaction id  (Heikki Linnakangas <hlinnaka@iki.fi>)
Responses Re: 2PC transaction id  (Heikki Linnakangas <hlinnaka@iki.fi>)
List pgsql-hackers
Heikki Linnakangas wrote:
> On Fri, 1 Jul 2005, Oliver Jowett wrote:
> 
>> Heikki Linnakangas wrote:
>>
>>> branch id: Branch Identifier. Every RM involved in the global
>>> transaction is given a *different* branch id.
>>
>>
>> Hm, I am confused then -- the XA spec definitely talks about enlisting
>> multiple RMs in a single transaction branch.
>>
>> Can you explain?
> 
> I oversimplified a bit. The TM *can* enlist multiple threads of control
> (= connection in JTA) to the same transaction branch. That's called
> "tightly-coupled threads", and they should then be treated as one local
> transaction in the RM.

Ok, I understand that case.

What I'm confused about is, for example, 3.3.1 in the DTP:XA spec:

> 3.3.1 Registration of Resource Managers
> Normally, a TM involves all associated RMs in a transaction branch. (The TM’s set of
> RM switches, described in Section 4.3 on page 21 tells the TM which RMs are
> associated with it.) The TM calls all these RMs with xa_start(), xa_end(), and
> xa_prepare (), although an RM that is not active in a branch need not participate further
> (see Section 2.3.2 on page 8). A technique to reduce overhead for infrequently-used
> RMs is discussed below.

That implies it's valid (in fact, normal!) to enlist many different RMs
in the same transaction branch. Am I interpreting that correctly?

-O


pgsql-hackers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: 2PC transaction id
Next
From: Neil Conway
Date:
Subject: Re: pl/pgsql: END verbosity [patch]