| Previous | Next |
| hrNullKeyDisallowed | hrTooManyActiveUsers |
hrNotInTransaction
Diagnostic focus
hrNotInTransaction means the operation requires a transaction but the supplied session has no active save point.
This is the legacy Directory Service backup/restore HRESULT form of JET_errNotInTransaction (0xC800041E).
The key comparison is: hrInTransaction is the inverse state error for operations forbidden inside a transaction. The first useful observation is to trace JetBeginTransaction and every matching commit/rollback on the same JET_SESID. This evidence shows whether the failure is nesting, ownership, cursor-local conflict, cross-session contention, or changed row state.
The ESE objects in play
| Diagnostic layer | JET_SESID transaction depth, row versions, and write ownership |
|---|---|
| Typical API surface | JetBeginSession, JetBeginTransaction, JetCommitTransaction, JetRollback, and update APIs |
| Code-specific condition | the operation requires a transaction but the supplied session has no active save point |
| First corrective direction | wrap the complete atomic sequence in a balanced transaction on one correctly owned session |
Each begin must be matched by commit or rollback on the same session. Nested ESE transactions are save points and still share the outer session context.
Evidence that resolves the ambiguity
- Code-specific observation: trace JetBeginTransaction and every matching commit/rollback on the same JET_SESID.
- the row version and business preconditions observed before the write; associate it with this result rather than with a later generic exception.
- every begin, commit, and rollback for the exact JET_SESID; associate it with this result rather than with a later generic exception.
- transaction depth, thread owner, cursor handles, and target bookmark or key.
Nearby results that mean something different
hrInvalidSesid | the JET_SESID is stale, foreign to the instance, or otherwise invalid |
|---|---|
hrSessionWriteConflict | two cursors in the same session attempted incompatible replacement of one record |
hrInTransaction | an operation that requires transaction level zero was invoked while the session has an active transaction |
A disciplined correction path
- Freeze the failing request context and record
0xC800041E, the Jet API name, and the current instance/session ownership. - Verify the code-specific precondition: trace JetBeginTransaction and every matching commit/rollback on the same JET_SESID.
- Apply the targeted fix: wrap the complete atomic sequence in a balanced transaction on one correctly owned session.
- Before retrying the operation, reconcile transaction depth, lock release, row version, and application-level idempotency.
Actions that can hide or worsen the problem
- Do not blindly retry a non-idempotent update after a conflict.
- Do not share a session with an open transaction across unrelated threads or requests.
Technical references
Looking for a different code? Search another status or error code.