From: Heikki Linnakangas <hlinnakangas@vmware.com>
To: Bryan Varner <bvarner@polarislabs.com>
Cc: pgsql-jdbc@postgresql.org <pgsql-jdbc@postgresql.org>
Subject: Re: PostgreSQL XAResource & GlassFish 3.1.2.2
Date: Wed, 13 Feb 2013 19:55:28 +0200
Message-ID: <511BD390.30608@vmware.com> (raw)
In-Reply-To: <511BAF49.8040706@polarislabs.com>
References: <A2B35D2698B0C74F9B8333525E67ED0135F89007@plindyexch02.polarislabs.lan>
<511A2C7F.1040104@vmware.com>
<511A675B.3020207@polarislabs.com>
<511A8BAC.7080400@vmware.com>
<CAF-4BpMPm3v1sVh=G2W3frMDb3MTJcuqxx4Uc2ZLPKtpM4Ws9Q@mail.gmail.com>
<CADK3HHLzykmBHGnfb62TmZ-8qYzNEeo=6qQR77pEq-yxoLScLg@mail.gmail.com>
<CADK3HHK_FtmUTCp9i2k4HjPt0xW9GnO3aKF0P=62oY8LyvGWSg@mail.gmail.com>
<511A8FC5.5040107@polarislabs.com>
<A2B35D2698B0C74F9B8333525E67ED0135FABC78@plindyexch02.polarislabs.lan>
<511B8E0D.6010103@vmware.com>
<511BAF49.8040706@polarislabs.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-jdbc>
On 13.02.2013 17:20, Bryan Varner wrote:
> I've been doing a lot (a LOT) of catching up on JTA over the last few
> days, and I have some concerns about some of the sanity checks in the
> driver.
I'm all ears.
>> Another reason is that because the implementation doesn't support
>> transaction interleaving and suspend/resume, it checks that the
>> transaction manager doesn't try to do that. If it does, you get a
>> meaningful error, "Transaction interleaving not implemented". That's a
>> clue to the user to configure the transaction manager to not do that.
>
> Fair enough, if the TM allows for that configuration.
It's not required by the spec, but in practice all the TM's have an
option for that, because many JDBC implementations don't support those
features; the PostgreSQL driver isn't alone with that.
> After synchronizing the methods, the 'failures' we're getting in regards
> to TM invocation of the XAResources seem to all be centered around
> section 3.4.6 part of the JTA spec.
>
> Specifically, we're seeing commit() invoked with xid's that don't match
> the XAResource's currentXid, as well as commit() called on connections
> which have no currentXid. This appears to be behavior that's within spec...
Right, assuming they are 2nd phase commits (onephase parameter ==
false), the TM is free to use any XAResource instance. The PG driver
requires the XAResource to not be associated with a transaction, however.
> I understand that XA isn't easy to do (or else everyone would), but it's
> almost like the PG implementation is missing a layer of indirection
> between the physical connections (pegged to currently serviced xids) and
> the logical connections in use by the client application. I think the
> best way I can describe this is, from what I'm seeing, it's like JTA
> expects the XAResource being returned by an XAConnection isn't pegged to
> (or required to represent) a physical connection, but (potentially)
> operates upon one or more physical connections to service the
> invocations of the TM upon the appropriate physical connection.
>
> Am I completely off the mark here?
I think it's more like the JTA authors expect there to be methods in the
underlying FE/BE protocol to associate/disassociate a transaction from
the physical connection.
The JTA spec is based on the X/Open spec, which was written for a quite
a different world. I think the X/Open spec assumes a single operating
system process running a single thread; being able to suspend/resume a
transaction makes a lot more sense in that context. It didn't translate
well to the Java world.
- Heikki
--
Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-jdbc
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: hlinnakangas@vmware.com, bvarner@polarislabs.com
Subject: Re: PostgreSQL XAResource & GlassFish 3.1.2.2
In-Reply-To: <511BD390.30608@vmware.com>
References: <A2B35D2698B0C74F9B8333525E67ED0135F89007@plindyexch02.polarislabs.lan> <511A2C7F.1040104@vmware.com> <511A675B.3020207@polarislabs.com> <511A8BAC.7080400@vmware.com> <CAF-4BpMPm3v1sVh=G2W3frMDb3MTJcuqxx4Uc2ZLPKtpM4Ws9Q@mail.gmail.com> <CADK3HHLzykmBHGnfb62TmZ-8qYzNEeo=6qQR77pEq-yxoLScLg@mail.gmail.com> <CADK3HHK_FtmUTCp9i2k4HjPt0xW9GnO3aKF0P=62oY8LyvGWSg@mail.gmail.com> <511A8FC5.5040107@polarislabs.com> <A2B35D2698B0C74F9B8333525E67ED0135FABC78@plindyexch02.polarislabs.lan> <511B8E0D.6010103@vmware.com> <511BAF49.8040706@polarislabs.com> <511BD390.30608@vmware.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