| Previous | Next |
| DB_S_NORESULT | DB_S_GOALCHANGED |
DB_S_CANTRELEASE
OLE DB lock cannot be released or downgraded before transaction end
DB_S_CANTRELEASE is HRESULT 265930 (0x00040ECA) from Microsoft OLE DB. The documented description is “Server cannot release or downgrade a lock until the end of the transaction.” The high-order severity bit is clear, so this is a success result, but it carries more information than plain S_OK.
The requested lock release or downgrade did not occur because the server must retain the lock until the transaction completes.
Evidence to preserve
- Preserve transaction identifier and isolation level.
- Preserve row or object locked.
- Preserve requested and actual lock modes.
- Preserve blocking sessions.
- Preserve commit or rollback timing.
Where the result is encountered
- This result can appear in rowset lock management; record the producing interface and method.
- This result can appear in transactional update cursors; record the producing interface and method.
- It can appear in providers exposing explicit lock-strength operations; record the producing interface and method.
State to verify
The central question is whether the caller understands that the transaction still owns the stronger lock and accounts for its blocking impact.
Diagnostic sequence
- Capture the raw HRESULT
0x00040ECAimmediately after the returning method and record whether the caller usedSUCCEEDED,FAILED, equality testing, or exception translation. - Verify the method-specific state: the caller understands that the transaction still owns the stronger lock and accounts for its blocking impact.
Difference from nearby HRESULT values
DB_S_LOCKUPGRADED reports a stronger acquired lock; it reports that an existing lock must remain.
Correct handling, retry, and recovery
Finish or shorten the transaction when safe. Repeating the same downgrade request inside the unchanged transaction will not release the lock.
Practical validation scenario
A long transaction requests a row-lock downgrade after reading. The provider keeps the lock, so the application completes validation and commits promptly instead of spinning on release.
Developer and administrator guidance
References
Looking for a different code? Search another status or error code.