Re: XA rollback problem

Lists: pgsql-jdbc
From: "Niels Beekman" <n(dot)beekman(at)wis(dot)nl>
To: <pgsql-jdbc(at)postgresql(dot)org>
Subject: XA rollback problem
Date: 2006-04-21 14:24:59
Message-ID: 50CA25BD6EEA954FA592C097399942E30E463D84@CM1.wis.local
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-jdbc

Hi,

All inserts or updates I do using PGXADatasource get rolled back
silently (no exceptions). I reproduced the problem using a simple test
table with a single int2-column.

As you can see in the driver logging it uses one-phase commit. I think
the problem is in the part that states *CommandStatus(ROLLBACK)*, the
driver just proceeds to ending and committing the transaction.

Does anyone have a clue how I would debug this further? I could not find
much XA-documentation on the site.

Thanks,

Niels

Query:
INSERT INTO test (test_id) VALUES (0)

Configuration:
Driver: both 404 and 405
Server: both 8.0 and 8.1
Tomcat: 5.5
Transactionmanager: SimpleJTA 1.04

Relevant logging:

-- DriverManager.setLogWriter(new PrintWriter(System.out));
-- Driver.setLogLevel(Driver.DEBUG);

XAResource 13d21d6: starting transaction xid =
SimpleXidImpl[format=1c131d0a,gtrid={txmgrId=TM1,txmgrBirthTime=11456292
11806,myBirthTime=1145629233910,id=13}, bqual={1}]
simple execute,
handler=org.postgresql.jdbc2.AbstractJdbc2Statement$StatementResultHandl
er(at)1d26552, maxRows=0, fetchSize=0, flags=5
FE=> Bind(stmt=S_1,portal=null)
FE=> Execute(portal=null,limit=0)
FE=> Parse(stmt=null,query="INSERT INTO test (test_id) VALUES
(0)",oids={})
FE=> Bind(stmt=null,portal=null)
FE=> Describe(portal=null)
FE=> Execute(portal=null,limit=1)
FE=> Sync
<=BE BindComplete [null]
<=BE CommandStatus(BEGIN)
<=BE ParseComplete [null]
<=BE BindComplete [null]
<=BE NoData
<=BE CommandStatus(INSERT 0 1)
<=BE ReadyForQuery(T)
simple execute,
handler=org.postgresql.jdbc2.AbstractJdbc2Connection$TransactionCommandH
andler(at)1fa157c, maxRows=0, fetchSize=0, flags=22
FE=> Bind(stmt=S_2,portal=null)
FE=> Execute(portal=null,limit=1)
FE=> Sync
<=BE BindComplete [null]
<=BE CommandStatus(ROLLBACK)
<=BE ReadyForQuery(I)
XAResource 13d21d6: ending transaction xid =
SimpleXidImpl[format=1c131d0a,gtrid={txmgrId=TM1,txmgrBirthTime=11456292
11806,myBirthTime=1145629233910,id=13}, bqual={1}]
XAResource 13d21d6: committing xid =
SimpleXidImpl[format=1c131d0a,gtrid={txmgrId=TM1,txmgrBirthTime=11456292
11806,myBirthTime=1145629233910,id=13}, bqual={1}] (one phase)


From: Kris Jurka <books(at)ejurka(dot)com>
To: Niels Beekman <n(dot)beekman(at)wis(dot)nl>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: XA rollback problem
Date: 2006-04-21 20:11:11
Message-ID: Pine.BSO.4.63.0604211505360.1040@leary2.csoft.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-jdbc

On Fri, 21 Apr 2006, Niels Beekman wrote:

> All inserts or updates I do using PGXADatasource get rolled back
> silently (no exceptions). I reproduced the problem using a simple test
> table with a single int2-column.

Could you show us the java test code you are using as well?

> As you can see in the driver logging it uses one-phase commit. I think
> the problem is in the part that states *CommandStatus(ROLLBACK)*, the
> driver just proceeds to ending and committing the transaction.

The log alone isn't really enough to see what's going on here, because it
doesn't show the Parse for the S_2 statement. It is unclear whether the
driver is issuing a commit or a rollback here.

Kris Jurka