pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bryan Varner <bvarner@polarislabs.com>
To: 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: Wed, 13 Feb 2013 17:20:14 -0500
Message-ID: <511C119E.8070409@polarislabs.com> (raw)
In-Reply-To: <1360793146.49585.YahooMailNeo@web162902.mail.bf1.yahoo.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>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-jdbc>

>> Why would each XAConnection need it's own pool?
>
> Because one PostgreSQL connection can't interleave transactions,
> and you can't commit or roll back a prepared transaction in a
> connection which has a transaction open.  I thought you wanted to
> be able to do such things.  They could be done if one XAConnection
> could map to more than one PostgreSQL connection.

Assuming that each logical XAConnection is backed by exactly one 
physical PGPooledConnection (and all connections are busy servicing an 
XID) then the situation you've described is completely accurate, and no 
different than the situation posed by the current XA implementation.

Adding one physical connection to the data source, for use by the 
XAResource control signals (commit / rollback / recover / etc.) should 
be sufficient to avoid a deadlock in a client app. (you'd have to be 
able to queue the control statements and synchronously respond)

I don't think you need a 'pool' per XAConnection, but you may need a 
number of extra physical connections in order to dispatch / handle 
non-xa invocations.

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)  latest in thread

Message-ID: <511C119E.8070409@polarislabs.com>
Permalink:  ../511C119E.8070409@polarislabs.com/
Also on:    postgresql.org/message-id/511C119E.8070409@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, kgrittn@ymail.com, hlinnakangas@vmware.com
  Subject: Re: PostgreSQL XAResource & GlassFish 3.1.2.2
  In-Reply-To: <511C119E.8070409@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>

* 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