Skip to content

Conversation

@jahnvi480
Copy link
Contributor

@jahnvi480 jahnvi480 commented Nov 25, 2025

Work Item / Issue Reference

AB#40635

GitHub Issue: #291


Summary

This pull request refactors how query timeouts are set for statement handles in the mssql_python/cursor.py module. The main improvement is moving the logic for setting the query timeout from the execute method to the cursor initialization process, ensuring the timeout is consistently applied whenever the statement handle is allocated or reset.

Statement handle timeout management:

  • Introduced a new _set_timeout method to set the query timeout attribute on the statement handle during cursor initialization, following best practices for performance. (mssql_python/cursor.py)
  • Removed redundant timeout-setting logic from the execute method, centralizing timeout management in the cursor lifecycle. (mssql_python/cursor.py)

@github-actions github-actions bot added the pr-size: small Minimal code update label Nov 25, 2025
@github-actions github-actions bot added pr-size: medium Moderate update size and removed pr-size: small Minimal code update labels Nov 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-size: medium Moderate update size

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants