Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1U61gS-0002Su-9C for pgsql-jdbc@arkaria.postgresql.org; Thu, 14 Feb 2013 16:29:16 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1U61gR-0001mC-Pk for pgsql-jdbc@arkaria.postgresql.org; Thu, 14 Feb 2013 16:29:15 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1U61gR-0001m7-5Y for pgsql-jdbc@postgresql.org; Thu, 14 Feb 2013 16:29:15 +0000 Received: from mail.polarislabs.com ([64.72.132.35] helo=plindyet01.polarislabs.lan) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1U61gP-0005AJ-7n for pgsql-jdbc@postgresql.org; Thu, 14 Feb 2013 16:29:14 +0000 Received: from PLINDYCAS01.polarislabs.lan (192.168.25.34) by mail.polarislabs.com (192.168.25.33) with Microsoft SMTP Server (TLS) id 14.1.438.0; Thu, 14 Feb 2013 11:29:04 -0500 Received: from bvarner-desktop.polarislabs.lan (172.16.2.73) by PLINDYCAS01.polarislabs.lan (192.168.25.34) with Microsoft SMTP Server (TLS) id 14.1.438.0; Thu, 14 Feb 2013 11:29:05 -0500 Message-ID: <511D10D2.2040202@polarislabs.com> Date: Thu, 14 Feb 2013 11:29:06 -0500 From: Bryan Varner User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.16) Gecko/20121215 Iceowl/1.0b1 Icedove/3.0.11 MIME-Version: 1.0 To: Florent Guillaume CC: Kevin Grittner , Heikki Linnakangas , "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> <511BD390.30608@vmware.com> <1360787037.52062.YahooMailNeo@web162904.mail.bf1.yahoo.com> <511C05A8.7060001@polarislabs.com> <1360793146.49585.YahooMailNeo@web162902.mail.bf1.yahoo.com> <511C119E.8070409@polarislabs.com> In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [172.16.2.73] X-Pg-Spam-Score: -0.2 (/) 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 02/14/2013 09:59 AM, Florent Guillaume wrote: > Ah I didn't realize that PG could issue a COMMIT PREPARED from a > different connection than the one that issued the PREPARE TRANSACTION > but thinking about it it's logical. Yep, it sure does. > So I believe that the setup you propose (having one additional control > connection) could be useful. You could probably avoid using it (and > therefore synchronizing work) if the physical connection is not > already reassociated to another XID. As I've been thinking about this, in theory unless all the physical connections are consumed servicing an XID and have been suspended by the TM, at some indeterminate point in time, at least -one- of them will have an end() invoked, and become available for use to service the XAResource invocation. Only if all the connections created by the datasource are in a suspended TX would there be a potential for a 'deadlock' needing an extra control connection -- and even then, that would be an extreme corner-case -- one that I'd like would recover at some point with a TM-driven TX timeout, or the TM deciding to resume a suspended TX. I know this would play out in a case where there's a lot of REQUIRES_NEW branching going on, but I haven't quite nailed down (mentally) a case where this could occur without the TM exhausting a pool (if it's even using one). Regards, -Bryan Varner -- Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-jdbc