Uploaded image for project: 'MariaDB Connector/J'
  1. MariaDB Connector/J
  2. CONJ-711

Xid format id is unsigned integer, currently sending as signed value

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Fixed (View Workflow)
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 2.4.0
    • Fix Version/s: 2.4.2
    • Component/s: XA
    • Labels:
      None

      Description

      Quoted from KB:

      The xid can have 3 components, though only the first one is mandatory. gtrid is a quoted string representing a global transaction identifier. bqual is a quoted string representing a local transaction identifier. formatID is an unsigned integer indicating the format used for the first two components bq.

      In XA spec:

      If OSI CCR naming is used, then
      the XID’s formatID element should be set to 0; if some other format is used, then the
      formatID element should be greater than 0.

      JDBC XID format ID is an Integer. (Java Integer is signed 32bit numeric).

      native Xid format is :

      struct xid_t {
      long formatID; /∗ format identifier ∗/
      long gtrid_length; /∗ value 1-64 ∗/
      long bqual_length; /∗ value 1-64 ∗/
      char data[XIDDATASIZE];
      };
      

      websphere for example create formatID according to this format (https://github.com/OpenLiberty/open-liberty/blob/464735a8588770d8ce055a4505f53c9a029b12ab/dev/com.ibm.tx.core/src/com/ibm/tx/jta/impl/XidImpl.java#L155)

      So Xid formatId value has better to be sent in hexa. Integer conversion to byte won't then have any signed / unsigned consideration.

        Attachments

          Activity

            People

            Assignee:
            diego dupin Diego Dupin
            Reporter:
            diego dupin Diego Dupin
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: