| Previous | Next |
| STG_E_INUSE | STG_E_REVERTED |
STG_E_NOTCURRENT
A stale-writer warning
STG_E_NOTCURRENT means another open instance of the storage committed changes after the caller’s view was established. The HRESULT is valuable because it prevents a stale writer from quietly overwriting a newer committed version. It is therefore not a reason to force a write; it is a version-conflict signal.
Microsoft documents the condition for IStorage::Commit and recommends STGC_ONLYIFCURRENT when multiple simultaneous writers are not prohibited. This turns a hidden lost-update risk into a detectable failure that the application can resolve deliberately.
Correct recovery pattern
- Stop the current commit and preserve the caller’s pending changes separately.
- Reopen or reload the latest committed storage before deciding whether changes can be replayed safely.
- Compare the semantic data, not only timestamps; two writers may have changed the same stream differently.
- Use a single-writer design, a lock/lease, or an explicit merge policy for documents that must support concurrent edits.
References
- Microsoft: IStorage::Commit and STGC_ONLYIFCURRENT
- Microsoft: Structured Storage HRESULT values
- Apache POI: POIFS compound files
Looking for a different code? Search another status or error code.