[
https://jira.jboss.org/jira/browse/JBTM-297?page=com.atlassian.jira.plugi...
]
Jonathan Halliday commented on JBTM-297:
----------------------------------------
The original
new String(data)
format was indeed flawed - it can loose data depending on the charset issues, and dumps a
bunch of nulls as the end of the string which make log files binary rather than text and
thus tricky to grep cleanly.
However, it does have one overriding benefit: it's easy to see the Uid string form in
the output. Since that format is used elsewhere in logging, this helps relate Xids to
their owning transactions.
e.g.
BasicAction::onePhaseCommit() for action-id -53ef7d80:a876:4a0d6fc1:2
...
XAResourceRecord.topLevelOnePhaseCommit for < 131075, 27, 25,
494545535110110255100564858975655545852974810054102994958504553511011025510056485897565554585297481005410299495851
>
does not illustrate any clear correlation other than through the function names, whereas
BasicAction::onePhaseCommit() for action-id -53ef7d80:a876:4a0d6fc1:2
...
XAResourceRecord.topLevelOnePhaseCommit for ( < 131075, 27, 25,
1--53ef7d80:a876:4a0d6fc1:2, -53ef7d80:a76a:4a0d75a6:3 > )
is easy to follow or search for in the log output based on the action Uid value.
On balance I'm going to reinstate something close to the original form, although as
seen above we now separate the string representation of the data into gtrid and bqual
elements and strip the nulls rather than treating data as one big lump.
Because of the way XATxConverter builds XIDds from Uid string forms, this use of String
should result in reasonable log output where Xids are created and rendered on the same JVM
(or JVMs using the same charset), which is the dominant use case. (The conversion of
nodename to byte data in XATxConverter is a problem for another day)
Improve XID printing
--------------------
Key: JBTM-297
URL:
https://jira.jboss.org/jira/browse/JBTM-297
Project: JBoss Transaction Manager
Issue Type: Feature Request
Security Level: Public(Everyone can see)
Components: JTA
Affects Versions: 4.2.3.SP5
Reporter: Mark Little
Assignee: Jonathan Halliday
Priority: Minor
Fix For: 4.4.0.GA
Printing the byte array through String loses information.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira