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

Re: [BUGS] BUG #2444: XA Connections given by posgres driver has

From: Kris Jurka <books(at)ejurka(dot)com>
To: Jagadish Prasath Ramu <jagadish(dot)ramu(at)Sun(dot)COM>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: [BUGS] BUG #2444: XA Connections given by posgres driver has
Date: 2006-05-22 20:14:14
Message-ID: Pine.BSO.4.63.0605221510340.26500@leary2.csoft.net (view raw or flat)
Thread:
Lists: pgsql-bugspgsql-jdbc
Moving to -jdbc.

On Fri, 19 May 2006, Jagadish Prasath Ramu wrote:

> The following bug has been logged online:
>
> Bug reference:      2444
> Description:        XA Connections given by posgres driver has auto-commit
> value false by default
> Details:
>
> Problem with PostgresDriver : postgresql-8.1-405.jdbc3.jar
>
> I am using the above driver to get an XA Connection and I found that
> auto-commit value of it is false by default.
>
> Source : org/postgresql/xa/PGXAConnection.java
> Constructor :
>
> PGXAConnection(BaseConnection conn) throws SQLException
>    {
>        super(conn, false);
>        this.conn = conn;
>        this.conn.setAutoCommit(false);
>        this.state = STATE_IDLE;
>        this.logger = conn.getLogger();
>    }
>
>
>> From JDBC Specification 3.0, Chapter 10.1.1 > Disabling AutoCommit mode :
>
> " The default is for auto-commit mode to be enabled when the Connection
> object is
> created. If the value of auto-commit is changed in the middle of a
> transaction, the
> current transaction is committed. It is an error to enable auto-commit for
> a
> connection participating in a distributed transaction, as described in
> Chapter 12
> Distributed Transactions. "
>
> Chapter 12 > 12.4 Transaction Management :
> "In contrast to the local case, the boundaries of a
> distributed transaction must be controlled by an external transaction
> manager that is
> coordinating the work of multiple connections. For this reason, it is an
> error for
> applications to call any of the following Connection methods while they are
> participating in a distributed transaction:
> setAutoCommit(true)
> commit
> rollback
> setSavepoint
> The JDBC driver throws an SQLException if one of these operations is
> attempted
> on a connection that is participating in a distributed transaction. If the
> connection is
> later used for a local transaction, these operations are legal at that
> point."
>
>> From these excerpts what I could understand is auto-commit for XA's
> connection need to be true when created and auto-commit can not be set to
> true when a transaction in progress.
>

I'm not sure what the purpose of this is.  Why would you want a connection 
to be in autocommit = true when this is a condition you are explicitly not 
allowed to set yourself?

Kris Jurka

In response to

Responses

pgsql-bugs by date

Next:From: Bruce MomjianDate: 2006-05-22 20:30:29
Subject: Re: BUG #2449: out of range
Previous:From: AnjaliDate: 2006-05-22 11:53:00
Subject: BUG #2450: change the type of existing column

pgsql-jdbc by date

Next:From: Glenn HolmerDate: 2006-05-22 22:34:06
Subject: DatabaseMetaData
Previous:From: Kris JurkaDate: 2006-05-22 19:55:13
Subject: Re: Updated German translation

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