Re: Postgres XA support - Mailing list pgsql-jdbc

From Ludovic Orban
Subject Re: Postgres XA support
Date
Msg-id c016d00b0610310751w3c9ce170y3296d83895565d4@mail.gmail.com
Whole thread Raw
In response to Re: Postgres XA support  (Heikki Linnakangas <heikki@enterprisedb.com>)
List pgsql-jdbc
Heikki,

> > Weblogic's connection pool has a parameter called
> > local-transaction-supported which when set to false will disallow
> > local transactions to be executed on connections taken from that pool.
>
> The WebLogic manual isn't very helpful, this is all I found regarding
> that parameter:
>
> "local-transaction-supported — Optional. Boolean. Set the
> local-transaction-supported to true if the XA driver supports SQL with
> no global transaction; otherwise, set it to false. The default value is
> false."
>
> It doesn't actually say what difference it makes or why you would want
> to set it to true. I don't see how a transaction manager could generally
> make use of the feature, because it doesn't know if a transaction is
> distributed or not until it's committed or the second resource is enlisted.

It's not the transaction manager but the connection pool (this is a
parameter of the connection pool, not of the TM !) that is going to
use this feature. If it detects you're using a connection outside a
tm.begin() / tm.commit() block it will throw a SQLException.

To achieve this you need tight integration between the connection pool
and the TM but that's definitely possible. I think I should implement
that as well.


> > I guess you could enforce the same behavior in the driver by throwing
> > a SQLException when some query is executed and XAResource.start() has
> > not been called yet or XAResource.end() has already been called.
>
> That seems like the easiest solution. We'll have to wrap the Connection
> object returned by PGXAConnection.getConnection so we can intercept
> execute-calls, though.

That sounds good enough.

Cheers,
Ludovic

pgsql-jdbc by date:

Previous
From: "Ludovic Orban"
Date:
Subject: Re: Postgres XA support
Next
From: Kris Jurka
Date:
Subject: Re: confused about transactions and connection pools