| Previous | Next |
| MQ_ERROR_TRANSACTION_USAGE | MQ_ERROR_MISSING_CONNECTOR_TYPE |
MQ_ERROR_TRANSACTION_SEQUENCE
Why the exact HRESULT matters
Applications should keep MQ_ERROR_TRANSACTION_SEQUENCE attached to the exact MSMQ call that produced it; translating it immediately to “queue error” discards the diagnostic boundary. The result marks transactional operation order is invalid. The begin/send/receive/commit or abort sequence no longer matches the transaction state.
For MQ_ERROR_TRANSACTION_SEQUENCE, A transaction error can occur before enlistment, during resource-manager participation, or after the application has issued work but before the outcome is durable. When diagnosing MQ_ERROR_TRANSACTION_SEQUENCE, retry policy must account for an uncertain commit result.
Transaction identifiers and completion ownership are essential. In the MQ_ERROR_TRANSACTION_SEQUENCE path, two threads attempting to commit, abort, or consume the same locked message can turn a recoverable application bug into duplicate processing.
Subsystem context
| Subsystem | MSMQ internal or coordinated transactions and their MS DTC enlistment |
|---|---|
| Decisive boundary | transaction type, queue locality, operation order, and enlistment state determine whether the action is legal |
| Code-specific focus | transactional operation order is invalid |
| Primary recovery rule | Reconstruct the call order and ensure one owner controls completion. |
When diagnosing MQ_ERROR_TRANSACTION_SEQUENCE, A transport retry is not equivalent to transaction recovery. In the MQ_ERROR_TRANSACTION_SEQUENCE path, first determine whether the unit of work committed, aborted, remains in doubt, or never enlisted. For MQ_ERROR_TRANSACTION_SEQUENCE, the code-specific boundary is transactional operation order is invalid.
Minimum useful telemetry
- Begin, enlist, send/receive, prepare, commit, and abort timestamps; associate it explicitly with
MQ_ERROR_TRANSACTION_SEQUENCE. - When diagnosing
MQ_ERROR_TRANSACTION_SEQUENCE, transaction identifier and whether it is internal, ambient, or dtc-coordinated; capture the value before cleanup or retry changes it. - In the
MQ_ERROR_TRANSACTION_SEQUENCEpath, queue transactional flag and local/remote placement; compare it with a known-good call using the same account and queue type. - For this
MQ_ERROR_TRANSACTION_SEQUENCEresult, record the queue path or format name, local/remote placement, transactional flag, caller SID, process build, and UTC correlation ID when they apply.
For MQ_ERROR_TRANSACTION_SEQUENCE, log certificate thumbprints, provider names, SIDs, GUIDs, lengths, and hashes where useful, but do not log private keys, symmetric keys, credentials, or confidential message bodies.
Step-by-step diagnosis
- Record the unsigned HRESULT,
MQ_ERROR_TRANSACTION_SEQUENCE, and the native API or COM method before a framework replaces it with a generic exception. - When diagnosing
MQ_ERROR_TRANSACTION_SEQUENCE, verify the postcondition after the failed call: queue existence, message presence, directory object state, transaction outcome, or generated output may differ by result. - In the
MQ_ERROR_TRANSACTION_SEQUENCEpath, capture transaction identifier and whether it is internal, ambient, or DTC-coordinated. - For this
MQ_ERROR_TRANSACTION_SEQUENCEresult, capture queue transactional flag and local/remote placement. - Reproduce with the smallest queue/message/property set that still returns
MQ_ERROR_TRANSACTION_SEQUENCE; change one precondition at a time. - When diagnosing
MQ_ERROR_TRANSACTION_SEQUENCE, apply the code-specific recovery rule: Reconstruct the call order and ensure one owner controls completion.
Retry and cleanup
Reconstruct the call order and ensure one owner controls completion.
When diagnosing MQ_ERROR_TRANSACTION_SEQUENCE, do not hide this HRESULT behind an unlimited framework retry. In the MQ_ERROR_TRANSACTION_SEQUENCE path, require a verified precondition change and preserve the original correlation identifier across the next attempt.
Avoiding a false diagnosis
In the MQ_ERROR_TRANSACTION_SEQUENCE path, do not convert the operation to a nontransactional send merely to suppress the HRESULT; that changes delivery and atomicity guarantees. The specific focus for MQ_ERROR_TRANSACTION_SEQUENCE remains transactional operation order is invalid.
- In the
MQ_ERROR_TRANSACTION_SEQUENCEpath, A successful test under an interactive administrator account does not prove that the production service account has the same profile, token, directory access, or key permissions. - For this
MQ_ERROR_TRANSACTION_SEQUENCEresult, restarting MSMQ before collecting evidence can invalidate handles and erase the first useful event; it is a containment action, not a root-cause diagnosis.
Example
A transactional receiver encounters MQ_ERROR_TRANSACTION_SEQUENCE. For MQ_ERROR_TRANSACTION_SEQUENCE, it correlates the MSMQ call with the DTC transaction ID and final outcome before replaying business work. When diagnosing MQ_ERROR_TRANSACTION_SEQUENCE, the acceptance test then changes only the decisive precondition and confirms both the HRESULT and the actual queue/message state.
For MQ_ERROR_TRANSACTION_SEQUENCE, include a negative test for the nearest misleading diagnosis so monitoring and user guidance do not collapse distinct MSMQ failures into one alert.
References
- Microsoft: MSMQTransaction.Commit and transaction model links — source used for the
MQ_ERROR_TRANSACTION_SEQUENCEanalysis. - Microsoft: DTC Developers Guide — source used for the
MQ_ERROR_TRANSACTION_SEQUENCEanalysis. - Microsoft: enable MS DTC diagnostic tracing — source used for the
MQ_ERROR_TRANSACTION_SEQUENCEanalysis. - Microsoft: destination queues — source used for the
MQ_ERROR_TRANSACTION_SEQUENCEanalysis. - Microsoft: Message Queuing error and information codes — source used for the
MQ_ERROR_TRANSACTION_SEQUENCEanalysis.
Looking for a different code? Search another status or error code.