| Previous | Next |
| XACT_S_DEFECT | XACT_S_SOMENORETAIN |
XACT_S_READONLY
Transaction completed through the read-only path
XACT_S_READONLY is HRESULT 315394 (0x0004D002) from winerror.h. The documented description is “The method call succeeded because the transaction was read-only.” The severity bit indicates a nonfailure result, but the value carries a specific condition that must not be collapsed into plain S_OK.
In the COM transaction and MSDTC protocol, this result means that the method call succeeded because the transaction was read-only. Before reporting completion, the caller must reconcile the code-specific state transition and every usable output.
Where the status is encountered
- ITransaction commit or abort processing; log the exact method and object state instead of interpreting the constant outside that contract.
- Resource-manager enlistment and coordinated outcomes; log the exact method and object state instead of interpreting the constant outside that contract.
- Transaction event-sink notification passes; log the exact method and object state instead of interpreting the constant outside that contract.
Evidence to preserve
- Preserve unit of work.
- Preserve enlisted resource list.
- Preserve read and write operations observed.
- Preserve prepare votes.
- Preserve final transaction outcome.
What must be true before accepting it
Verify that no enlisted resource produced durable changes and the optimized outcome matches the application operation. Without that proof, it can mask a caller error even though HRESULT failure severity is not set.
Reconcile side effects associated with it before compensation or a second invocation is attempted.
Correct handling and recovery
Accept the optimized completion, but verify that no expected write was silently skipped. Record which resources voted read-only and close the transaction normally.
Difference from nearby results
Correctly separating it from neighboring values selects the proper continuation and cleanup path.
Practical scenario
A reporting transaction queries two databases and performs no updates. Both resources vote read-only, allowing the coordinator to avoid write-phase work.
References
- Microsoft: COM transaction status codes — official Microsoft material relevant to this HRESULT.
- Microsoft: ITransaction::Commit
- Microsoft: ITransaction::Abort
- Microsoft: HRESULT values
Looking for a different code? Search another status or error code.
