XA rollback problem

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
Thread:
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)

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message tarabas 2006-04-21 16:52:00 Problems with Timestamp and Function Calls in JDBC/Prepared Statement
Previous Message Dave Cramer 2006-04-21 11:27:40 Re: Bug with callable statement and output parameters