| Previous | Next |
| MQ_ERROR_DTC_CONNECT | MQ_ERROR_TRANSACTION_USAGE |
MQ_ERROR_TRANSACTION_IMPORT
Operational meaning
The important part of MQ_ERROR_TRANSACTION_IMPORT is not only whether the call failed, but which MSMQ subsystem had enough information to return this specific result. In this case the decisive subject is transaction propagation/import failed. MSMQ received a transaction reference it could not import into the local transaction manager.
MSMQ supports internal single-queue transactions and coordinated transactions involving MS DTC. When diagnosing this result, queue type, destination locality, receive locality, and ambient transaction propagation constrain which operations are valid.
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 to draw the boundary
| 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 | transaction propagation/import failed |
| Primary recovery rule | Capture propagation tokens and DTC traces; do not substitute a new transaction mid-operation. |
When diagnosing this result, 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 transaction propagation/import failed.
Evidence to preserve
- Begin, enlist, send/receive, prepare, commit, and abort timestamps; associate it explicitly with this result.
- When diagnosing this result, transaction identifier and whether it is internal, ambient, or dtc-coordinated; capture the value before cleanup or retry changes it.
- In the path, queue transactional flag and local/remote placement; compare it with a known-good call using the same account and queue type.
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.
Diagnostic sequence
- Record the unsigned HRESULT, it, and the native API or COM method before a framework replaces it with a generic exception.
- In the path, verify the postcondition after the failed call: queue existence, message presence, directory object state, transaction outcome, or generated output may differ by result.
- capture queue transactional flag and local/remote placement.
- capture begin, enlist, send/receive, prepare, commit, and abort timestamps.
- When diagnosing it, apply the code-specific recovery rule: Capture propagation tokens and DTC traces; do not substitute a new transaction mid-operation.
Handling and recovery
Capture propagation tokens and DTC traces; do not substitute a new transaction mid-operation.
When diagnosing it, do not hide this HRESULT behind an unlimited framework retry., require a verified precondition change and preserve the original correlation identifier across the next attempt.
Nearby failure boundaries
In the 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 it remains transaction propagation/import failed.
- In the path, restarting MSMQ before collecting evidence can invalidate handles and erase the first useful event; it is a containment action, not a root-cause diagnosis.
- granting broad queue or certificate permissions may mask the symptom while creating a security defect. Test the exact identity and access needed by the operation.
Worked example
A dtc-coordinated workflow encounters it. It correlates the MSMQ call with the DTC transaction ID and final outcome before replaying business work.
A regression test should force it, assert the raw value and relevant outputs, then correct only the documented precondition and verify the intended success or neighboring HRESULT.
References
- Microsoft: MSMQTransaction.Commit and transaction model links — source used for the result analysis.
- Microsoft: DTC Developers Guide — source used for the result analysis.
- Microsoft: enable MS DTC diagnostic tracing — source used for the result analysis.
- Microsoft: destination queues — source used for the result analysis.
- Microsoft: Message Queuing error and information codes — source used for the result analysis.
Looking for a different code? Search another status or error code.
