Skip to content

FIX: Setting autocommit as False by default & add rollback on connection close #158

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Aug 6, 2025

Conversation

jahnvi480
Copy link
Contributor

@jahnvi480 jahnvi480 commented Jul 29, 2025

Work Item / Issue Reference

AB#38059


Summary

This pull request updates the default behavior of the autocommit setting in the MSSQL Python library, changing it from True to False. It also includes minor adjustments to tests and imports to reflect this change.

Default autocommit behavior changes:

Test updates:

Import cleanup:

@Copilot Copilot AI review requested due to automatic review settings July 29, 2025 11:45
@github-actions github-actions bot added the pr-size: small Minimal code update label Jul 29, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request changes the default autocommit behavior in the MSSQL Python library from True to False to align with standard database connection practices where transactions are explicit by default.

  • Updated default autocommit parameter from True to False in connection methods
  • Modified test assertions to reflect the new default behavior
  • Cleaned up unused import comments in test files

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
mssql_python/db_connection.py Changed default autocommit parameter to False in the connect function
mssql_python/connection.py Updated setautocommit method default parameter to False
tests/test_003_connection.py Updated test assertion and commented out unused imports

@github-actions github-actions bot added pr-size: small Minimal code update and removed pr-size: small Minimal code update labels Jul 29, 2025
@github-actions github-actions bot added pr-size: small Minimal code update and removed pr-size: small Minimal code update labels Jul 30, 2025
@github-actions github-actions bot added pr-size: small Minimal code update and removed pr-size: small Minimal code update labels Jul 31, 2025
@github-actions github-actions bot added pr-size: small Minimal code update and removed pr-size: small Minimal code update labels Jul 31, 2025
@bewithgaurav bewithgaurav changed the title FIX: Setting autocommit as False by default FIX: Setting autocommit as False by default & add rollback on connection close() Jul 31, 2025
@bewithgaurav bewithgaurav changed the title FIX: Setting autocommit as False by default & add rollback on connection close() FIX: Setting autocommit as False by default & add rollback on connection close Jul 31, 2025
@github-actions github-actions bot added pr-size: small Minimal code update and removed pr-size: small Minimal code update labels Jul 31, 2025
Copy link
Contributor

@sumitmsft sumitmsft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left some comments. Please resolve these.

@github-actions github-actions bot added pr-size: small Minimal code update and removed pr-size: small Minimal code update labels Aug 1, 2025
@github-actions github-actions bot added pr-size: small Minimal code update and removed pr-size: small Minimal code update labels Aug 5, 2025
@github-actions github-actions bot added pr-size: small Minimal code update and removed pr-size: small Minimal code update labels Aug 5, 2025
@bewithgaurav bewithgaurav merged commit 2f3ada6 into main Aug 6, 2025
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-size: small Minimal code update
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants