| Previous | Next |
| MQ_ERROR_TRANSACTION_IMPORT | MQ_ERROR_TRANSACTION_SEQUENCE |
MQ_ERROR_TRANSACTION_USAGE
Operational meaning
Applications should keep MQ_ERROR_TRANSACTION_USAGE attached to the exact MSMQ call that produced it. In this case the relevant subject is queue operation violates transaction rules. Common boundaries include transactional versus nontransactional queues, local receive requirements, and using a transaction where none is permitted.
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 this result, retry policy must account for an uncertain commit result.
Transaction identifiers and completion ownership are essential. Two threads attempting to commit, abort, or consume the same locked message can turn a recoverable application bug into duplicate processing.
Where the condition occurs
| Subsystem | MSMQ internal or coordinated transactions and their MS DTC enlistment |
|---|---|
| Relevant condition | transaction type, queue locality, operation order, and enlistment state determine whether the action is legal |
| Code-specific focus | queue operation violates transaction rules |
A transport retry is not equivalent to transaction recovery. First determine whether the unit of work committed, aborted, remains in doubt, or never enlisted. The code-specific boundary is queue operation violates transaction rules.
Evidence to preserve
- Begin, enlist, send/receive, prepare, commit, and abort timestamps.
- Transaction identifier and whether it is internal, ambient, or dtc-coordinated.
- Queue transactional flag and local/remote placement.
Handling and recovery
Correct the transaction/queue combination rather than retrying the same call.
Nearby failures
Do not convert the operation to a nontransactional send merely to suppress the HRESULT; that changes delivery and atomicity guarantees. Code-specific condition: queue operation violates transaction rules.
Worked example
A transactional receiver encounters it. It correlates the MSMQ call with the DTC transaction ID and final outcome before replaying business work.
References
Looking for a different code? Search another status or error code.
