Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1U5gYa-00087G-02 for pgsql-jdbc@arkaria.postgresql.org; Wed, 13 Feb 2013 17:55:44 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1U5gYZ-000852-GR for pgsql-jdbc@arkaria.postgresql.org; Wed, 13 Feb 2013 17:55:43 +0000 Received: from magus.postgresql.org ([87.238.57.229]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1U5gYY-00084B-6T for pgsql-jdbc@postgresql.org; Wed, 13 Feb 2013 17:55:42 +0000 Received: from smtp-outbound-1.vmware.com ([208.91.2.12]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1U5gYR-0008F1-8b for pgsql-jdbc@postgresql.org; Wed, 13 Feb 2013 17:55:41 +0000 Received: from sc9-mailhost3.vmware.com (sc9-mailhost3.vmware.com [10.113.161.73]) by smtp-outbound-1.vmware.com (Postfix) with ESMTP id 945E528763; Wed, 13 Feb 2013 09:55:31 -0800 (PST) Received: from zcs-prod-ext-mta-2.vmware.com (zcs-prod-ext-mta-2.vmware.com [10.113.62.224]) by sc9-mailhost3.vmware.com (Postfix) with ESMTP id 7E1884018A; Wed, 13 Feb 2013 09:55:31 -0800 (PST) Received: from localhost (localhost.localdomain [127.0.0.1]) by zcs-prod-ext-mta-2.vmware.com (Postfix) with ESMTP id EFFE9C153E; Wed, 13 Feb 2013 09:55:30 -0800 (PST) X-Virus-Scanned: amavisd-new at zcs-prod-ext-mta-2.vmware.com Received: from zcs-prod-ext-mta-2.vmware.com ([127.0.0.1]) by localhost (zcs-prod-ext-mta-2.vmware.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id AF6cqnZzQYav; Wed, 13 Feb 2013 09:55:30 -0800 (PST) Received: from zcs-prod-ext-mta-2.vmware.com (localhost.localdomain [127.0.0.1]) by zcs-prod-ext-mta-2.vmware.com (Postfix) with ESMTP id CAA2FC1525; Wed, 13 Feb 2013 09:55:30 -0800 (PST) Received: from [192.168.1.90] (unknown [10.113.62.14]) by zcs-prod-ext-mta-2.vmware.com (Postfix) with ESMTPSA; Wed, 13 Feb 2013 09:55:30 -0800 (PST) Message-ID: <511BD390.30608@vmware.com> Date: Wed, 13 Feb 2013 19:55:28 +0200 From: Heikki Linnakangas Organization: VMware User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.12) Gecko/20130116 Icedove/10.0.12 MIME-Version: 1.0 To: Bryan Varner CC: "pgsql-jdbc@postgresql.org" Subject: Re: PostgreSQL XAResource & GlassFish 3.1.2.2 References: <511A2C7F.1040104@vmware.com> <511A675B.3020207@polarislabs.com> <511A8BAC.7080400@vmware.com> , <511A8FC5.5040107@polarislabs.com> <511B8E0D.6010103@vmware.com> <511BAF49.8040706@polarislabs.com> In-Reply-To: <511BAF49.8040706@polarislabs.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -6.9 (------) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-jdbc Precedence: bulk Sender: pgsql-jdbc-owner@postgresql.org 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