From: Dave Cramer <davec@fastcrypt.com>
To: Heikki Linnakangas <hlinnaka@iki.fi>
Cc: List <pgsql-jdbc@postgresql.org>
Subject: Re: XA support
Date: Thu, 30 Jun 2005 15:08:01 -0400
Message-ID: <D90E9D45-AA91-4145-8E35-5D8A9010B3BD@fastcrypt.com> (raw)
In-Reply-To: <Pine.OSF.4.61.0506302116360.45052@kosh.hut.fi>
References: <Pine.OSF.4.61.0506291920120.108382@kosh.hut.fi>
<42C31E54.20000@opencloud.com>
<Pine.OSF.4.61.0506302116360.45052@kosh.hut.fi>
Heikki,
The folks at JONAS want to test the driver so I'd think they would
work with you on this.
Post this on the pgj2ee list.
Dave
On 30-Jun-05, at 2:37 PM, Heikki Linnakangas wrote:
> On Thu, 30 Jun 2005, Oliver Jowett wrote:
>
>
>> Heikki Linnakangas wrote:
>>
>>
>>> B. When the second transaction starts, the first transaction is
>>> prepared
>>> behind the scenes, freeing the connection for the new transaction.
>>>
>>
>> This is probably the way to go initially, since it's much simpler. It
>> should also deal with the more common uses of XA where you're just
>> coordinating 2 or more resources in an otherwise straightforward
>> begin-do stuff-commit sequence. We can get clever later :)
>>
>> Related issues: supporting this case:
>>
>> xaRes.start(xid1, XAResource.TMNOFLAGS);
>> stmt.executeUpdate("...");
>> xaRes.end(xid1, XAResource.TMSUSPEND);
>> // ...
>> xaRes.start(xid1, XAResource.TMRESUME);
>> stmt.executeUpdate("...");
>> xaRes.end(xid1, XAResource.TMSUCCESS);
>>
>
> This is essentially impossible with approach B, if the ... part
> uses the connection for some other xid. Otherwise, should work.
>
>
>> and this one:
>>
>> xaRes.start(xid1, XAResource.TMNOFLAGS);
>> stmt.executeUpdate("...");
>> xaRes.end(xid1, XAResource.TMSUCCESS);
>> // ...
>> xaRes.start(xid1, XAResource.TMJOIN);
>> stmt.executeUpdate("...");
>> xaRes.end(xid1, XAResource.TMSUCCESS);
>>
>
> Practically the same as above, really.
>
>
>> and this one (yow!):
>>
>> (thread 1):
>> xaRes.start(xid1, XAResource.TMNOFLAGS);
>> stmt.executeUpdate("...");
>>
>> (thread 2):
>> xaRes.start(xid1, XAResource.TMJOIN);
>> stmt.executeUpdate("...");
>>
>
> Note that the XA term "thread of control" actually means a
> connection in JTA terms. It doesn't make any difference which java
> thread does work. See JTA spec, section 3.4.3.
>
> I'm leaning towards approach C myself, since it's the simplest to
> implement and doesn't cause any unexpected prepares. Or possibly
> even violating the spec and not allowing to start another
> transaction before the previous one has been prepared. It depends
> on how the popular application servers behave in real life.
>
> - Heikki
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/docs/faq
>
>
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-jdbc@postgresql.org
Cc: davec@fastcrypt.com, hlinnaka@iki.fi
Subject: Re: XA support
In-Reply-To: <D90E9D45-AA91-4145-8E35-5D8A9010B3BD@fastcrypt.com>
References: <Pine.OSF.4.61.0506291920120.108382@kosh.hut.fi> <42C31E54.20000@opencloud.com> <Pine.OSF.4.61.0506302116360.45052@kosh.hut.fi> <D90E9D45-AA91-4145-8E35-5D8A9010B3BD@fastcrypt.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox