Site icon EfmSoft

What does HRESULT 0x80040E20 (DB_E_NOTREENTRANT) mean?

 
Previous Next
DB_E_NOQUERY DB_E_ERRORSOCCURRED

DB_E_NOTREENTRANT

Meaning

Windows documents DB_E_NOTREENTRANT as “Consumer's event handler called a non-reentrant method in the provider”. Here, consumer callback code calls a provider method that the provider marks as non-reentrant while the original call is still active.

Specific conditions that produce the result

  • Cause 1: a rowset notification handler calls back into the same rowset.
  • Cause 2: an error or progress callback starts another command on the same non-reentrant object.
  • Cause 3: synchronous application dispatch reenters provider code before the first stack unwinds.

Relevant OLE DB contract

This result must be interpreted against this contract: OLE DB objects follow both COM lifetime rules and provider-specific state contracts; open dependents, ownership transfer, aggregation, callbacks and namespace identity must be traced from the exact interface call rather than inferred from a wrapper exception.

Start with the COM object that returned the result and every dependent interface or provider-owned resource involved in the call when investigating this result.

Evidence to collect before changing the system

  • Evidence 1: the callback interface, reason and phase.
  • Evidence 2: the original provider method still active on the stack.
  • Evidence 3: thread ID, apartment and object identity for both calls.

Corrective actions

  • Action 1: defer provider work until after the callback returns.
  • Action 2: queue the operation onto an owning thread or event loop.
  • Action 3: use a separate object only when the provider documents concurrent use as safe.

Practical incident

A row-change notification immediately calls GetData on the same provider object during a non-reentrant phase; posting the read to the event loop prevents it.

Retry and recovery policy

Retry rule: retry after the original call has unwound and the deferred operation runs outside the callback.

Difference from related HRESULT values

DB_E_OBJECTOPEN is an object-lifetime conflict, while DB_E_NOTREENTRANT is a call-stack and callback-ordering violation.

Official Microsoft references


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

Exit mobile version