pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bryan Varner <bvarner@polarislabs.com>
To: Florent Guillaume <fg@nuxeo.com>
Cc: Kevin Grittner <kgrittn@ymail.com>
Cc: Heikki Linnakangas <hlinnakangas@vmware.com>
Cc: pgsql-jdbc@postgresql.org <pgsql-jdbc@postgresql.org>
Subject: Re: PostgreSQL XAResource & GlassFish 3.1.2.2
Date: Thu, 14 Feb 2013 11:29:06 -0500
Message-ID: <511D10D2.2040202@polarislabs.com> (raw)
In-Reply-To: <CAF-4BpNzo1vb+5orhMMKRO7PHvfngJ5FSTqoPMjojm5DhCpm+w@mail.gmail.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>
	<1360787037.52062.YahooMailNeo@web162904.mail.bf1.yahoo.com>
	<511C05A8.7060001@polarislabs.com>
	<1360793146.49585.YahooMailNeo@web162902.mail.bf1.yahoo.com>
	<511C119E.8070409@polarislabs.com>
	<CAF-4BpNzo1vb+5orhMMKRO7PHvfngJ5FSTqoPMjojm5DhCpm+w@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-jdbc>

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



view thread (24+ messages)

Message-ID: <511D10D2.2040202@polarislabs.com>
Permalink:  ../511D10D2.2040202@polarislabs.com/
Also on:    postgresql.org/message-id/511D10D2.2040202@polarislabs.com

 · 

reply

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: bvarner@polarislabs.com, fg@nuxeo.com, kgrittn@ymail.com, hlinnakangas@vmware.com
  Subject: Re: PostgreSQL XAResource & GlassFish 3.1.2.2
  In-Reply-To: <511D10D2.2040202@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> <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> <CAF-4BpNzo1vb+5orhMMKRO7PHvfngJ5FSTqoPMjojm5DhCpm+w@mail.gmail.com> <511D10D2.2040202@polarislabs.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