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 :
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.