Skip site navigation (1) Skip section navigation (2)

Re: JTA / JDBC support

From: Oliver Jowett <oliver(at)opencloud(dot)com>
To: Freddy Villalba Arias <fvillalba(at)madrid(dot)bilbomatica(dot)es>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: JTA / JDBC support
Date: 2004-04-05 21:48:58
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-jdbc
Freddy Villalba Arias wrote:
> Hi!
> Are there any drivers (for PostgreSQL v7.4.2) that support JTA?
> I’m interested in using JDBC 2.0, but I encourage you (and would greatly 
> appreciate it) to give me as much information as you can about JTA / 
> JDBC (different versions) support…

Short answer: the standard postgresql driver doesn't support XAResource, 
and it doesn't make sense to support it.

Long answer:

JTA defines XAResource as the interface between the Transaction Manager 
(TM) and Resource Manager (RM -- in this case the JDBC driver) for 
resources that can participate in two-phase commit of global 
transactions. While there's support for a one-phase optimization, that's 
an option on the part of the TM, not the RM. There's no specification in 
JTA of the interface between the TM and RM for local or one-phase 
transactions AFAIK.

As the PostgreSQL backend itself (let alone the driver) doesn't support 
two-phase commit or global transactions, it doesn't really make sense 
for the driver to implement XAResource. It could implement it and then 
refuse all requests to prepare transactions or switch transaction 
context, but I don't know how useful that would be since it depends so 
much on the TM's behaviour.

But I'd be surprised if your TM of choice did not support enlistment of 
one-phase JDBC resources directly (with a bit of help from the app 
server, which has to actually do the enlistment at the right point) 
using the normal commit/rollback JDBC interface to talk to the driver.


In response to

pgsql-jdbc by date

Next:From: Oliver JowettDate: 2004-04-05 21:56:49
Subject: Re: what is lslowing me down? JDBC or Postgresql itself?
Previous:From: Oliver JowettDate: 2004-04-05 21:40:37
Subject: Re: blob without largeobject api

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group