Skip to content

Commit 2fe7557

Browse files
committed
clarify begin behaviour and remove confusing best practice
1 parent e23f300 commit 2fe7557

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

docsrc/Connecting_and_queries.rst

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -995,7 +995,7 @@ Explicit transaction control
995995

996996
When ``autocommit=False``, you can use explicit transaction statements to control when changes are committed or rolled back. The SDK supports the standard SQL transaction commands.
997997

998-
**Important**: ``BEGIN`` and ``BEGIN TRANSACTION`` statements are **not supported** when ``autocommit=False`` because transactions are started implicitly with the first SQL statement. Attempting to execute ``BEGIN`` will result in an error.
998+
**Important**: ``BEGIN`` and ``BEGIN TRANSACTION`` statements are **not supported** when ``autocommit=False`` because transactions are started implicitly with the first SQL statement. Attempting to execute ``BEGIN`` will result in an error. With ``autocommit=True`` executing ``BEGIN`` has no effect.
999999

10001000
.. _explicit_transaction_example:
10011001

@@ -1132,8 +1132,7 @@ Best practices
11321132
1. **Use autocommit=False for multi-statement operations** that need to be atomic
11331133
2. **Always handle exceptions** when using transactions and include proper rollback logic
11341134
3. **Keep transactions short** to minimize lock contention and improve performance
1135-
4. **Use connection-level commit/rollback methods** when working with multiple cursors
1136-
5. **Leverage context managers** for automatic transaction cleanup
1135+
4. **Leverage context managers** for automatic transaction cleanup
11371136

11381137
Transaction limitations and notes
11391138
---------------------------------

0 commit comments

Comments
 (0)