[CONJ-387] Wrong XAException return code at prepare when provided uknown Xid Created: 2016-11-11  Updated: 2019-10-15  Resolved: 2019-10-15

Status: Closed
Project: MariaDB Connector/J
Component/s: Other
Affects Version/s: 1.5.4
Fix Version/s: N/A

Type: Bug Priority: Minor
Reporter: Ondra Chaloupka Assignee: Diego Dupin
Resolution: Not a Bug Votes: 0
Labels: None


 Description   

By my testing I spotted fact that calling prepare on MaridaDB XAResource throws XAException.XAER_RMFAIL when provided uknown Xid instead of XAException.XAER_NOTA as xa specification denotes.

[XAER_NOTA]
The specified XID is not known by the resource manager



 Comments   
Comment by Diego Dupin [ 2019-09-13 ]

Sorry for late answer.
MariaDB error code (https://mariadb.com/kb/en/library/mariadb-error-codes/) :

1397 XAE04 ER_XAER_NOTA XAER_NOTA: Unknown XID
1398 XAE05 ER_XAER_INVAL XAER_INVAL: Invalid arguments (or unsupported command)
1399 XAE07 ER_XAER_RMFAIL XAER_RMFAIL: The command cannot be executed when global transaction is in the %s state

Connector implementation :

I fail to reproduce this error and don't see how this is possible: if MariaDB server return "Unknown XID" message, error code 1397 is obligatory associate. association error code to xa error is done by this code: https://github.com/MariaDB/mariadb-connector-j/blob/master/src/main/java/org/mariadb/jdbc/MariaXaResource.java#L97

Comment by Ondra Chaloupka [ 2019-10-14 ]

diego+dupin hi. Thanks for looking at this. You're right. I would tip that I used a wrong configuration and I correctly got XAER_RMFAI as a wrong state for the global transaction id. I rechecked with my test and I correctly get the XAER_NOTA. Please, close this issue as rejected.
Once again, thanks for looking into this.

Comment by Diego Dupin [ 2019-10-15 ]

closing as indicate

Generated at Thu Feb 08 03:15:17 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.