pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bryan Varner <bvarner@polarislabs.com>
To: Heikki Linnakangas <hlinnakangas@vmware.com>
Cc: pgsql-jdbc@postgresql.org <pgsql-jdbc@postgresql.org>
Cc: Kevin Grittner <kgrittn@ymail.com>
Cc: Florent Guillaume <fg@nuxeo.com>
Subject: Re: Working toward a JTA 1.0.1 Compliant XADataSource
Date: Sat, 16 Feb 2013 19:52:58 -0500
Message-ID: <512029EA.3050509@polarislabs.com> (raw)
In-Reply-To: <511FE5FB.6000503@vmware.com>
References: <A2B35D2698B0C74F9B8333525E67ED0135FF12E8@plindyexch02.polarislabs.lan>
	<511FE5FB.6000503@vmware.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-jdbc>

> Sorry to hear that. I'd be interested to have an isolated, stand-alone
> test application that reproduces the problem, so that I could also play
> with it.

Now that we've been able to reproduce it in our test environments, it's 
far more likely we can do that. I'd be happy to send you some debug logs 
from the pgjdbc driver, where it documented what was going on.

> Frankly, I don't think this is worth the trouble, or worth complicating
> the driver for. It would be nice to be fully compliant, just so we could
> say that we are, but in practice, meh.

If the existing implementation actually worked for my case, I'd agree 
with you. It's not working for me, so at this point, I disagree.

> The PostgreSQL driver is not alone with the limitations. I believe
> Oracle has similar limitations, as does MySQL, and DB2. Which is why all
> application servers I've bumped into this far have options to work
> around them. I'm very surprised if Glassfish doesn't. In practice, a
> transaction manager that insists on working support for transaction
> interleaving and suspend/resume, is pretty useless.

While we are not seeing join / suspend / resume, we are seeing the 
expectation that you can commit a previously prepared TX while already 
working on a new TX. I've read the JTA specification through several 
times at this point, and I'm not sure if that should be considered 
interleaving, or properly implementing the resource sharing aspect of 
XAResource.

Here's the configuration options for the GlassFish version we're using.
http://docs.oracle.com/cd/E18930_01/html/821-2416/beanp.html#scrolltoc

The closest thing to interleaving I see is 
ALLOW_MULTIPLE_ENLISTS_DELISTS, which is disabled (false) by default.

> IMHO it was a serious mistake from the JTA spec authors to require those
> extra features. They are not required for robust two-phase commit, and
> are difficult to implement in many JDBC drivers, including PostgreSQL's.

I too, hope this gets fixed in the 2.0 spec.

>> We love PostgreSQL. It's done very well for us in the past and we'd
>> like to give back by making it a better product for everyone to use.
>> This looks like a pretty good place to start doing that.
>
> I think the best action here would be to expand the FAQ with specific
> information on how to set up the data source on various app servers
> (http://jdbc.postgresql.org/documentation/faq.html). And if Glassfish
> doesn't yet provide a suitable work-around option, petition them to
> implement one.

I have been in contact with a few of the GlassFish developers. I will 
try to see if there is something they could do in a future version.

GlassFish is a bigger, slower moving project at this point, and I don't 
have the time to wait for them to change their JTA implementation.

>> https://github.com/polarislabs/pgjdbc/tree/POLARIS_XA
>
> There seems to be some unrelated refactoring in this branch, moving
> files around, so it's a bit hard to see what the real changes are.

To get better support for code completion in a few IDE's we moved things 
into a 'src' directory, and updated the build.xml to handle it.

We added a protected method to the PGPoolingConnection so that 
subclasses can obtain the underlying Connection without having to cache 
it as a private member variable.

The XADataSource now implements most of the XA control invocation, and 
extends AbstractXADataSource, which is the file filtered to extend the 
proper spec version implementation by the ant build.

> One random thought just occurred to me: while I don't think this is
> worth the complexity in the PostgreSQL driver, would it be possible to
> implement this as a generic wrapper that could be used with any
> XADataSource implementation?

That's essentially what we're doing with this implementation... except 
that we're tied to the pgjdbc build system to make sure we build for the 
right version of the jdbc spec, and the PostgreSQL dialect.

It certainly would be 'possible' to wrap a normal DataSource into an XA 
compliant pool and provide different implementations for different spec 
versions and dialects.

> The concept of implementing the transaction
> interleaving and suspend/resume by adding yet another layer of pooling
> seems pretty universal. It could then be used with any application
> server which doesn't already provide a work-around option, and with any
> JDBC implementation that has these limitations.

Having it work for 'any' database is a lofty goal, would take a lot more 
time, and won't help address the problem I have any faster. From a 
practical engineering standpoint, what you're proposing is a very large 
undertaking, and one that won't help me resolve my situation any faster 
than sticking to one database, one driver, and two jdbc version specs.

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 (14+ messages)  latest in thread

Message-ID: <512029EA.3050509@polarislabs.com>
Permalink:  ../512029EA.3050509@polarislabs.com/
Also on:    postgresql.org/message-id/512029EA.3050509@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, hlinnakangas@vmware.com, kgrittn@ymail.com, fg@nuxeo.com
  Subject: Re: Working toward a JTA 1.0.1 Compliant XADataSource
  In-Reply-To: <512029EA.3050509@polarislabs.com>
  References: <A2B35D2698B0C74F9B8333525E67ED0135FF12E8@plindyexch02.polarislabs.lan> <511FE5FB.6000503@vmware.com> <512029EA.3050509@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