Skip to content

Add ODBC connection pooling design plan (ADO #47317) - #293

Draft
Saurabh Singh (saurabh500) wants to merge 1 commit into
mainfrom
saurabh500-odbc-connection-pooling-plan
Draft

Add ODBC connection pooling design plan (ADO #47317)#293
Saurabh Singh (saurabh500) wants to merge 1 commit into
mainfrom
saurabh500-odbc-connection-pooling-plan

Conversation

@saurabh500

@saurabh500 Saurabh Singh (saurabh500) commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Summary

Base PR for the mssql-odbc connection pooling effort (ADO #47317). Adds the design plan at docs/odbc-connection-pooling-plan.md.

The plan enables mssql-python's existing client-side pool to safely reuse a physical Rust ODBC connection — no second pool in Rust; we supply only the ODBC/TDS reset, liveness, transaction, and isolation semantics that make reuse safe.

Key findings captured in the doc

  • Cross-referenced the original msodbcsql C++ driver (discoveries D1–D9).
  • D9: sp_reset_connection does not reset the transaction isolation level (a SQL Server limitation). mssql-python works around this in PR #343 by re-applying SET TRANSACTION ISOLATION LEVEL READ COMMITTED on every checkout — our SQL_ATTR_TXN_ISOLATION handler must honor this and carry the armed reset bit.
  • D3: confirmed gap — fatal error tokens (severity ≥ 20) don't currently mark the transport dead.

Implementation stages (tracked as ADO child Tasks of #47317)

  1. Stage 1 — mssql-tds reset correctness (reset-ack centralization + fatal-error liveness) — [AB#47337]
  2. Stage 2 — ODBC pooling primitives (SQL_ATTR_CONNECTION_DEAD + SQL_ATTR_RESET_CONNECTION) — [AB#47338]
  3. Stage 3 — Reset acking + isolation carrier — [AB#47339]
  4. Stage 4 — Auth/recovery, ODBC tests, mssql-python e2e — [AB#47340]

Each stage will land as its own PR stacked on top of this base.

Notes

  • Docs-only change; no code or tests affected.
  • Related work item: AB#47317.

Design plan for enabling connection pool constructs in mssql-odbc so
mssql-python's client-side pool can safely reuse a physical Rust ODBC
connection. Covers reset/liveness/isolation semantics, msodbcsql
cross-reference, and a 4-stage implementation breakdown.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 63e24621-7665-4572-a5b8-e5dfa55060a0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant