Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.7k
Description
Documentation
Insqlite3,@malemburgspecified thatconnect(),commit(), androllback() implicitly open transactions in the newPEP-249 manual commit mode implemented in PR#93823:
If this is set to False, the module could then implement the
correct way of handling transactions, which means:a) start a new transaction when the connection is opened
b) start a new transaction after .commit() and .rollback()
c) don't start new transactions anywhere else
d) run an implicit .rollback() when the connection closes
So I expect to see that information clearly documented.
Yet the PR documented it only forcommit() androllback() (item b), not forconnect() (item a):
* :mod:`!sqlite3` ensures that a transaction is always open, so :meth:`Connection.commit` and :meth:`Connection.rollback` will implicitly open a new transaction immediately after closing the pending one.To me it is important to document it also forconnect() rather than relying on user’s deduction, which is not obvious at all since for instance inlegacy manual commit mode,sqlite3 doesnot implicitly open transactions whenconnect() is called but whenexecute() is called on a DML statement.
Linked PRs
Metadata
Metadata
Assignees
Projects
Status