You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "Daniel John Debrunner (JIRA)" <de...@db.apache.org> on 2006/02/23 00:36:38 UTC

[jira] Commented: (DERBY-1016) javax.transaction.xa.forget (Xid) raises XAER_NOTA exception instead of XA_PROTO on a prepared transaction

    [ http://issues.apache.org/jira/browse/DERBY-1016?page=comments#action_12367447 ] 

Daniel John Debrunner commented on DERBY-1016:
----------------------------------------------

Reading the javadoc for XAResource I think I agree with you,  XAER_PROTO is the correct error.

XAResource.recover()

"The transaction manager calls this method during recovery to obtain the list of transaction branches that are currently in prepared or heuristically completed states."

XAResource.forget

"Tells the resource manager to forget about a heuristically completed transaction branch."

Thus a prepared transaction is not a heuristically completed transaction branch and therefore is not a valid state for forget.

  



> javax.transaction.xa.forget (Xid) raises XAER_NOTA exception instead of XA_PROTO on a prepared transaction
> ----------------------------------------------------------------------------------------------------------
>
>          Key: DERBY-1016
>          URL: http://issues.apache.org/jira/browse/DERBY-1016
>      Project: Derby
>         Type: Bug
>   Components: JDBC
>     Versions: 10.2.0.0, 10.1.2.3, 10.1.3.0
>     Reporter: Kathey Marsden

>
> javax.transaction.xa.forget (Xid) raises XAER_NOTA exception instead of XA_PROTO on a prepared transaction
> I posted a question to derby-dev about this and heard no response so am assuming it is indeed a bug.
>  in  the  XA+ 
> specification, it seems like xa_forget should  only be valid for a
> heuristically completed transaction, so should  be  XAER_PROTO
> and not XAER_NOTA.
> 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;
> 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() );
>              

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira