Transactions ============ `cTDS` utilizes the `IMPLICIT_TRANSACTIONS`_ feature of `Microsoft SQL Server`_ for transaction management. This approach was chosen given the similarities to the `DB API 2.0 specification `_ . The spec implies that transactions are implicitly created, but must be explicitly committed, using the :py:meth:`k_ctds.Connection.commit()` method, or rolled back, using the :py:meth:`k_ctds.Connection.rollback` method. `cTDS` supports disabling of the use of `IMPLICIT_TRANSACTIONS`_ if desired. In this case the :py:meth:`k_ctds.Connection.commit()` and :py:meth:`k_ctds.Connection.rollback()` methods have no affect and transactions are implicitly commited after each call to :py:meth:`k_ctds.Cursor.execute()`, :py:meth:`k_ctds.Cursor.executemany()` or :py:meth:`k_ctds.Cursor.callproc()`. Autocommit ^^^^^^^^^^ The `autocommit` parameter to :py:func:`k_ctds.connect()` and :py:attr:`k_ctds.Connection.autocommit` controls the use of `IMPLICIT_TRANSACTIONS`_. When :py:obj:`True`, transactions are implicitly committed after an operation and calls to :py:meth:`k_ctds.Connection.commit()` are unnecessary (`IMPLICIT_TRANSACTIONS`_ is set to **OFF**). .. _IMPLICIT_TRANSACTIONS: https://learn.microsoft.com/en-us/sql/t-sql/statements/set-implicit-transactions-transact-sql .. _Microsoft SQL Server: https://www.microsoft.com/sql-server