Code example for MSSQL in documentation is not thread-safe
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 62/100
- Issue type
- Documentation
- Clarity
- Clearly specified
- Activity status
- Stale
- Domain
- databases, documentation
Research direction
Start with the Connect Streamlit to Microsoft SQL Server documentation page and review its current connection example. Replace the cached pyodbc connection as requested with st.experimental_connection, then verify that the example addresses concurrent sessions without the reported invalid cursor state errors.
Written by the indexing model from the issue text.
Description
The documentation page Connect Streamlit to Microsoft SQL Server recommends using @st.cache_resource to store the pyodbc connection, but when I did (using FreeTDS) and had multiple concurrent sessions, Streamlit produced "invalid cursor state" errors. When I changed the code to store the connection in st.session_state instead, the errors stopped happening. It appears that pyodbc is not thread-safe.
### Tasks
- [ ] Use `st.experimental_connection` in SQL Server tutorial
- Dominant language
- JavaScript
- Stars
- 178
- Forks
- 705
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 39
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from streamlit/docs
-
docs needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
-
docs needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
docs needs triage
Difficulty 3/5 1-2 days Newbie friendliness 35/100
-
bug needs triage
Difficulty 4/5 3-5 days Newbie friendliness 35/100
-
docs needs triage
Difficulty 3/5 1-2 days Newbie friendliness 48/100
Similar issues
-
code-quality refactoring
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
github/gh-aw-firewall#8816 ·
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
langchain-ai/deepagents#6450 ·
-
optimization optimization:agents-md-curator
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
githubnext/gh-aw-cao#13143 ·
-
status: needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100