Failure Recovery Examples
These examples show what monSQLize does when common runtime paths fail and recover. Use them when you want to see rollback, retry, fallback, and timeout behavior before applying the same pattern in your application.
Example Summary
Run The Examples
npm run test:examples builds the package, compiles the TypeScript examples, starts the required local MongoDB memory servers, and runs the executable example list.
After the examples have been compiled, you can run one recovery example directly:
What To Check
- Rollback: Failed transaction work is not visible after rollback.
- Sync recovery: Failure counters increase, then successful sync resumes and target stats update.
- Lock timeout: A busy lock fails predictably, and a later attempt succeeds after release.
- Pool fallback: Reads move to the fallback pool while analytics is unavailable, then return when the pool recovers.