What does HRESULT 0x80670009 (STATEREPOSITORY_E_LOCKED_RETRY) mean?

 
Previous Next
STATEREPOSITORY_E_BUSY_RECOVERY_RETRY STATEREPOSITORY_E_LOCKED_SHAREDCACHE_RETRY

STATEREPOSITORY_E_LOCKED_RETRY

Within Windows StateRepository, STATEREPOSITORY_E_LOCKED_RETRY reports that a table-level lock prevented the request and the caller may retry. Diagnosis of this result should follow the original owner and generation rather than treating the visible symptom as the cause.

Facts that change the diagnosis

  • Locked table or operation.
  • Connection and active statement.
  • Transaction mode.
  • Retry owner and ordering.

Subsystem meaning

A connection can reach table contention even when the database file itself is accessible. Capture the table and unfinished statement because retrying on another thread may reproduce the same lock ownership.

Isolation workflow

  1. First: Complete or reset the statement holding the table.
  2. Next: Serialize writers touching the same table.
  3. Then: Retry only after the owning transaction advances.
  4. Finally: Use a controlled two-connection reproduction.

Avoid the tempting broad fix

BUSY_RETRY is database-level contention; LOCKED_RETRY is a narrower table or connection-sharing conflict.

Do not open unbounded extra connections to escape the lock.

Expected branches

ControlInterpretationHold constant
Same database copy, isolated connectionsA change points to connection/statement/transaction ownership rather than stored content.Use a copy and preserve schema plus repository generation.
Same operation, controlled environmentIf the result follows one machine, account, volume, network, or device, environment matters.Keep versions and identity explicit rather than comparing only the final message.

Regression proof

Verify it with the original scenario, one boundary case, and one deliberate failure; success means the two-connection test follows the intended ordering and no statement remains active across unrelated work.

Technical references


Looking for a different code? Search another status or error code.