| Previous | Next |
| hrDatabaseCorrupted | hrTableLocked |
hrDatabaseLocked
Interpretation in ESE terms
hrDatabaseLocked means the database is locked against the requested access mode.
This is the legacy Directory Service backup/restore HRESULT form of JET_errDatabaseLocked (0xC80004B7).
The key comparison is: hrDatabaseInUse is ordinary active use; this code indicates a lock preventing the requested access. The first useful observation is to identify the owning process/session, file share modes, ESE attachment state, and maintenance or recovery operation. This evidence separates file identity, attachment, open-handle ownership, lock state, and structural validity.
The ESE objects in play
| Diagnostic layer | database file, attachment state, JET_DBID ownership, and database lifecycle |
|---|---|
| Typical API surface | JetCreateDatabase, JetAttachDatabase, JetOpenDatabase, JetCloseDatabase, and JetDetachDatabase |
| Code-specific condition | the database is locked against the requested access mode |
| First corrective direction | remove the legitimate owner cleanly or schedule exclusive work during a controlled outage |
Creating an empty file is not a valid substitute for a missing or corrupted ESE database. Attachment is an instance relationship; opening a database returns a session-scoped database ID.
Comparison with adjacent failures
hrDatabaseInvalidPages | the requested initial or maximum database size is not a valid page count |
|---|---|
hrDatabaseNotFound | a valid database name or path did not resolve to an attached or existing database |
hrDatabaseInvalidName | the database-specific name fails rules beyond a generic object name check |
What to capture before retrying
- Code-specific observation: identify the owning process/session, file share modes, ESE attachment state, and maintenance or recovery operation.
- the instance attachment list plus every session-scoped JET_DBID; associate it with this result rather than with a later generic exception.
- open tables, transactions, maintenance, and recovery activity using the database.
- the canonical database path and file identity.
Actions that can hide or worsen the problem
- Do not create an empty database at the expected path as a substitute for the missing or damaged artifact.
- Do not force detach or delete while owners and recovery state are unknown.
Operational response
- Freeze the failing request context and record
0xC80004B7, the Jet API name, and the current instance/session ownership. - Verify the code-specific precondition: identify the owning process/session, file share modes, ESE attachment state, and maintenance or recovery operation.
- Apply the targeted fix: remove the legitimate owner cleanly or schedule exclusive work during a controlled outage.
- Before retrying the operation, reconcile attachment, open/closed state, file identity, and database header status.
Technical references
Looking for a different code? Search another status or error code.