Error
Error Code: 1397

MySQL Error 1397: XA Transaction Not Found

📦 MySQL
📋

Description

This error indicates that an XA (eXtended Architecture) transaction operation, such as COMMIT or ROLLBACK, was attempted using an XID (transaction identifier) that MySQL does not recognize. It typically occurs when the server has no record of an active XA transaction corresponding to the provided XID, leading to a failure in completing the distributed transaction.
💬

Error Message

XAER_NOTA: Unknown XID
🔍

Known Causes

4 known causes
⚠️
XA Transaction Already Completed
The XA transaction identified by the XID has already been successfully committed or rolled back by another process or an earlier attempt, making the current XID invalid.
⚠️
Incorrect or Stale XID
The application provided an XID that is incorrect, malformed, or refers to a transaction that was never started or has expired due to application logic errors or system restarts.
⚠️
Database Server Restart/Failure
A MySQL server restart or an unexpected crash can lead to the loss of in-memory XA transaction state, causing subsequent operations on previously valid XIDs to fail.
⚠️
External Coordinator Discrepancy
The external transaction coordinator (e.g., a message queue or application server) is out of sync with MySQL's view of the XA transaction state, leading to attempts to operate on non-existent XIDs.
🛠️

Solutions

Coming Soon

Detailed step-by-step solutions for this error are being prepared. In the meantime, try these general troubleshooting tips:

General Troubleshooting Tips

  • Check the error message carefully for specific details
  • Review recent changes that might have caused the error
  • Search for the exact error code in the official documentation
  • Check log files for additional context
  • Try restarting the application or service
🔗

Related Errors

5 related errors