XA rollback problem - Mailing list pgsql-jdbc

From Niels Beekman
Subject XA rollback problem
Date
Msg-id 50CA25BD6EEA954FA592C097399942E30E463D84@CM1.wis.local
Whole thread Raw
Responses Re: XA rollback problem  (Kris Jurka <books@ejurka.com>)
List 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@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@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)

pgsql-jdbc by date:

Previous
From: Dave Cramer
Date:
Subject: Re: Bug with callable statement and output parameters
Next
From: tarabas@tarabas.de
Date:
Subject: Problems with Timestamp and Function Calls in JDBC/Prepared Statement