Uploaded image for project: 'Derby'
  1. Derby
  2. DERBY-1016

javax.transaction.xa.forget (Xid) raises XAER_NOTA exception instead of XA_PROTO on a prepared transaction

    XMLWordPrintableJSON

Details

    • Normal
    • High Value Fix, Known fix, Newcomer, Release Note Needed, Repro attached

    Description

      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() );

      Attachments

        1. DERBY-1016_Patch_1.diff
          0.5 kB
          Ravinder Reddy
        2. DERBY-1016.diff
          4 kB
          Myrna van Lunteren
        3. DERBY-1016.patch
          3 kB
          Tiago R. Espinha
        4. DERBY-1016.patch
          2 kB
          Tiago R. Espinha
        5. derby1016-donotcommit.diff
          4 kB
          Jayaram Subramanian
        6. derby1016-stat.txt
          0.9 kB
          Jayaram Subramanian
        7. releaseNote.html
          1 kB
          Richard N. Hillegas
        8. releaseNote.html
          1 kB
          Richard N. Hillegas
        9. releaseNote.html
          1 kB
          Jayaram Subramanian
        10. ReproDerby1016.java
          3 kB
          Katherine Marsden
        11. runoutputNov30.out
          1 kB
          Jayaram Subramanian
        12. utilXid.java
          2 kB
          Katherine Marsden

        Activity

          People

            rsjay1976 Jayaram Subramanian
            kmarsden Katherine Marsden
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: