Skip to content
Prev Previous commit
Next Next commit
Clarify that implicit open or roll back happens in the same method call
  • Loading branch information
geryogam committed Nov 21, 2022
commit 261f21b905eb5ee9c8289255e910346d210d2f73
14 changes: 7 additions & 7 deletions Doc/library/sqlite3.rst
Original file line number Diff line number Diff line change
Expand Up @@ -637,24 +637,24 @@ Connection objects
Commit any pending transaction to the database.
If :attr:`autocommit` is ``True``, or there is no open transaction,
this method does nothing.
If :attr:`!autocommit` is ``False``, a new transaction is implicitly
opened if a pending transaction was committed by this method.
If :attr:`!autocommit` is ``False``, this method implicitly opens
a new transaction after committing.

.. method:: rollback()

Roll back to the start of any pending transaction.
If :attr:`autocommit` is ``True``, or there is no open transaction,
this method does nothing.
If :attr:`!autocommit` is ``False``, a new transaction is implicitly
opened if a pending transaction was rolled back by this method.
If :attr:`!autocommit` is ``False``, this method implicitly opens
a new transaction after rolling back.

.. method:: close()

Close the database connection.
If :attr:`autocommit` is ``False``,
any pending transaction is implicitly rolled back.
If :attr:`autocommit` is ``False``, this method implicitly rolls back
any open transaction before closing.
If :attr:`!autocommit` is ``True`` or :data:`LEGACY_TRANSACTION_CONTROL`,
no implicit transaction control is executed.
this method does not execute any implicit transaction control.
Make sure to :meth:`commit` before closing
to avoid losing pending changes.

Expand Down