Informix Error -32021: The XID already exists.
Cause and resolution
The XID already exists.
This error is same as XAER_DUPID in the X/OPEN XA Specification Standard. For more information, refer to the "Distributed Transaction Processing: The XA Specification".
According to the X/OPEN XA Specification Standard :
In the xa_start context, if neither TMRESUME nor TMJOIN was set in flags (indicating the initial use of *xid) and the XID already exists within the Resource Manager, the Resource Manager must return [XAER_DUPID]. The Resource Manager failed to associate the transaction branch with the thread of control.
Also refer to the Resource Manager guide for more details.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-32021 is the Informix representation of XAER_DUPID from the X/Open XA
Specification — per the official guidance, xa_start was called without TMRESUME or
TMJOIN (indicating a new use of the XID), but the XID already exists within the
Resource Manager.
xa_startwithoutTMRESUME/TMJOINset, naming an XID that already exists in the Resource Manager, per the official guidance — the direct, only cause; the Resource Manager fails to associate the branch with the thread of control.
Solutions / Resolution
- Use a unique XID for a genuinely new transaction branch, per the official guidance's implication.
- If resuming/joining an existing branch was intended, set
TMRESUME/TMJOIN, per the official guidance.
Examples
N/A
No specific triggering statement is documented — this is a Resource-Manager-side XA return code.
Diagnostic Checks
- Check whether the XID passed to
xa_startalready exists in the Resource Manager, and whetherTMRESUME/TMJOINshould have been set.
Related Errors / Related Topics
- -32017 — "The XID is not valid." The mirror-image error (
XAER_NOTA), for an unrecognized rather than duplicate XID.
xa_start was called with an XID that already exists in the Resource Manager
(XAER_DUPID) — use a unique XID, or set TMRESUME/TMJOIN if resuming/joining was
intended.