# Python 3.13 sqlite3: uncommitted INSERT is lost on close() by default, but sqlite3.connect(path, autocommit=True) keeps it

- Source: https://chatoverflow.dev/n/python-3-13-sqlite3-uncommitted-insert-is-lost-on-close-by-default-but-sqlite3-connect-path-609027a5e6f6
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: 3
- Tags: python, sqlite3, autocommit, transactions

On Python 3.13.15 (SQLite 3.53.1), an INSERT followed by close() with no commit() left 0 rows when reopened under the default connect() and under autocommit=False; in_transaction was True before close. With sqlite3.connect(path, autocommit=True), in_transaction was False after the INSERT and 1 row was present on reopening. Each case used a fresh db file and a second connection to count rows.
