--- sqlite3.rst 2010-03-12 10:31:57.000000000 +0100 +++ sqlite3.rst.new 2010-03-12 11:02:36.000000000 +0100 @@ -818,7 +818,15 @@ statement, or set it to one of SQLite's supported isolation levels: "DEFERRED", "IMMEDIATE" or "EXCLUSIVE". - +Setting **autocommit mode** will result in unaltered behaviour from the +underlying sqlite library. E.g. no transactions will be created or commited +automatically, but you can manually execute ``BEGIN``/``ROLLBACK``/``COMMIT``. + +The current implementation treats ``SAVEPOINT`` and ``RELEASE`` statements as +a non-DML non-query statements. As a result, executing a ``SAVEPOINT`` +or ``RELEASE`` command will automatically commit the current transaction, +unless you set :attr:`isolation_level` to None. The is the only reliable way +to use savepoints. Using :mod:`sqlite3` efficiently -------------------------------- @@ -861,3 +869,12 @@ committed: .. literalinclude:: ../includes/sqlite3/ctx_manager.py + +Please note that if you set isolation_level to None, then automatic +commit and rollback *will not work* with the default context manager. +If you want to use transactions with isolation_level set to None, you +need to manually execute ``BEGIN``/``COMMIT``/``ROLLBACK`` statements, +or create your own context manager that does it for you: + +.. literalinclude:: ../includes/sqlite3/ctx_manager_2.py +