Re: 2PC transaction id

From: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
To: Barry Lind <blind(at)xythos(dot)com>
Cc: Oliver Jowett <oliver(at)opencloud(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: 2PC transaction id
Date: 2005-07-01 17:35:07
Message-ID: Pine.OSF.4.61.0507012025270.496896@kosh.hut.fi
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, 1 Jul 2005, Barry Lind wrote:

>> 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. The calls will look like this:
>>
>> conn1.start(xid1, TMNOFLAGS);
>> ...
>> conn2.start(xid1, TMJOIN);
>> ...
>> conn1.end(xid1, TMSUCCESS);
>> ...
>> conn2.end(xid1, TMSUCCESS);
>>
>> connX.prepare(xid1);
>> connX.commit(xid1, false);
>>
>> conn1 and conn2 must share locks and see each others changes. They
>> mustn't deadlock each other. The JDBC driver can implement this in a
> very
>> straight-forward way by using the same physical connection for both
> conn1
>> and conn2. Note that there's only one prepare, and it can be issued
> using
>> any connection.
>
> In your example above couldn't conn1 and conn2 be running in two
> different JVMs? And thus your statement that 'the JDBC driver can
> implement this in a very straight-forward way by using the same physical
> connection' would not be true. I can't see a way for two JVMs (possibly
> on different client machines even) to share the same physical
> connection.

I can't immediately think of a reason why they couldn't run in two
different JVMs, but I also can't think of a reason why anyone would want
to do that. Can you give a use case for that?

Also, it would require an application server that would support that, and
I don't think there is any.

- Heikki

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2005-07-01 17:47:46 Regression test plpgsql vs. rangefuncs conflict
Previous Message Stephen Frost 2005-07-01 17:07:35 Re: [PATCHES] Users/Groups -> Roles