db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kathey Marsden <kmarsdende...@sbcglobal.net>
Subject Should xa_forget() on a prepared transaction cause XAER_NOTA or XAER_PROTO?
Date Mon, 20 Feb 2006 23:00:41 GMT
In xaStateTran.sql we have this case:

-- get back into prepared state
xa_start xa_noflags 50;
insert into xastate values(2);
xa_end xa_success 50;
xa_prepare 50;

select * from global_xactTable where gxid is not null order by gxid;

-- the following should error XAER_NOTA
xa_forget 50;

But actually looking at the state transitions  in  the  XA+ 
specification, it seems like xa_forget should  only be valid for a
heuristically completed transaction, so I think should  be  XAER_PROTO
and not XAER_NOTA.  Is that correct?


The user  code I am looking at handles forget like this. They expect 
XAER_PROTO in this case.
              
try {
             xaRes.forget(xidList[i]);
              System.out.print("XA-Transaction [" + (i+1) + "]
Forgotten. \n" );
} catch (XAException XAeForget) {
                        if ( XAeForget.errorCode ==
XAException.XAER_PROTO ) {
                            System.out.print("XA-Transaction [" + (i+1)
+ "] not heuristically completed yet - Rolling Back instead. \n" );
                            xaRes.rollback(xidList[i]);
                            System.out.print("XA-Transaction [" + (i+1)
+ "] Rolled Back. \n" );
                        }
                        if ( XAeForget.getMessage() != null ) {
                            System.out.println("XAException " +
XAeForget.getMessage() );
                        }








Mime
View raw message