| Previous | Next |
| DB_E_CANCELED | DB_E_BADSOURCEHANDLE |
DB_E_CHAPTERNOTRELEASED
Meaning
Windows documents DB_E_CHAPTERNOTRELEASED as “Rowset is single-chaptered. The chapter was not released”. In this case, a single-chapter rowset is asked to activate another chapter while the current chapter remains referenced.
Evidence to collect
When recording diagnostic data involving parent keys, chapter identifiers and hierarchical row values, use types, lengths, hashes or redacted identifiers rather than secrets or complete business data.
- Evidence 1: the current chapter handle and reference ownership.
- Evidence 2: all child objects created from the chapter.
- Evidence 3: the call sequence from chapter acquisition through attempted replacement.
Relevant contract
Chapter handles represent a provider-owned view into a hierarchical rowset. Single-chapter rowsets permit only one active chapter at a time, so chapter lifetime and release ordering are part of the method contract rather than optional cleanup.
Investigation of this result should start with the chaptered rowset, current HCHAPTER and every reference that keeps the old chapter active.
Conditions that specifically lead to it
- Cause 1: the consumer forgot to release the previous HCHAPTER.
- Cause 2: a child rowset or wrapper still retains the chapter.
- Cause 3: error cleanup skipped chapter release after an earlier operation.
Diagnostic sequence
- Identify the exact failing stage: a single-chapter rowset is asked to activate another chapter while the current chapter remains referenced.
Corrective actions
- Action 1: release child objects before releasing the chapter.
- Action 2: centralize HCHAPTER ownership in a scoped wrapper.
- Action 3: do not request a second chapter until the first release is confirmed.
Practical scenario
A hierarchical browser switches parents without closing the prior child chapter; deterministic cleanup permits the new chapter to open.
Retry and recovery
Retry rule: retry after the existing chapter and all dependent references have been released.
Difference from nearby HRESULT values
DB_E_BADCHAPTER means a supplied chapter handle is invalid, while DB_E_CHAPTERNOTRELEASED means the existing valid chapter is still active.
Official Microsoft references
Looking for a different code? Search another status or error code.