[issue39457] Add an autocommit property to sqlite3.Connection with a PEP 249 compliant manual commit mode and migrate

James Oldfield report at bugs.python.org
Tue Jan 5 06:27:54 EST 2021


James Oldfield <james.oldfield at cantab.net> added the comment:

If this ever gets implemented, "autocommit" would be a terrible name for it. That word has a very specific meaning in SQLite, which is essentially the same as "not in a transaction started with BEGIN ...". At the moment, if you want to explicitly control when transactions start (a good idea considering how confusing the current behaviour is) then you would set isolation_mode to None and manually start a transaction with `execute("BEGIN")` - at which point you are NOT in autocommit mode, until you commit or rollback. According to this proposal, if I want manual control over transactions, I would set `conn.autocommit = True`, even though I *don't* want autocommit mode (according to SQLite's definition)!

----------
nosy: +james.oldfield

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue39457>
_______________________________________


More information about the Python-bugs-list mailing list