| Previous | Next |
| XACT_E_UNKNOWNRMGRID | XACT_E_WRONGUOW |
XACT_E_WRONGSTATE
Transaction callbacks and application requests form a state machine
XACT_E_WRONGSTATE indicates that the method itself is recognized but cannot run in the transaction’s present phase. Examples include enlisting after completion has begun, reporting Prepared twice, committing an aborted branch, or acknowledging a Phase Two request before the corresponding prepare exchange.
Log state transitions, not just method names. For custom resource managers, serialize callback handling and persist durable state before returning the vote required by the protocol. For applications, prevent parallel commit and abort paths from racing. A retry is appropriate only after confirming that the state is transitional and the API explicitly allows the method later; terminal states require a new transaction.
State-machine evidence to collect
- Last successful protocol callback and response.
- Concurrent commit, abort, timeout, or shutdown activity.
- Whether the resource had durably recorded Prepared.
- Duplicate callback or completion notification count.
References
- Microsoft MS-DTCO: transaction lifecycle
- Microsoft: asynchronous resource-manager callbacks
- The Open Group: XA protocol state and return codes
Looking for a different code? Search another status or error code.