Unix Technical Forum

BUG #2444: XA Connections given by posgres driver has auto-commit value false by default

This is a discussion on BUG #2444: XA Connections given by posgres driver has auto-commit value false by default within the pgsql Bugs forums, part of the PostgreSQL category; --> The following bug has been logged online: Bug reference: 2444 Logged by: Jagadish Prasath Ramu Email address: jagadish.ramu@Sun.COM PostgreSQL ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Bugs

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-10-2008, 11:00 AM
Jagadish Prasath Ramu
 
Posts: n/a
Default BUG #2444: XA Connections given by posgres driver has auto-commit value false by default


The following bug has been logged online:

Bug reference: 2444
Logged by: Jagadish Prasath Ramu
Email address: jagadish.ramu@Sun.COM
PostgreSQL version: posgres driver
Operating system: Fedora Core 4, Solaris
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.

Thanks,
-Jagadish

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 06:04 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com