[DB-SIG] Adding Connection.autocommit as standard extension to DB-API 2.0 (PEP 249)

Mike Bayer mike_mp at zzzcomputing.com
Fri Oct 28 10:02:10 EDT 2022



On Fri, Oct 28, 2022, at 9:58 AM, Marc-Andre Lemburg wrote:
> If there is a pending transaction, though, there are three approaches
> we could take:
> 
> 1. The database module raises an exception, to force an explicit
>     .commit() or .rollback() by the programmer.
> 
> 2. The module automatically commits the pending transaction,
>     since that's what autocommit is all about.
> 
> 3. We leave these semantics open and up to the database module
>     to determine.
> 
> My preference would be option 2, since this makes things clear for
> everyone and is intuitive (well, at least for me :-)).

option 3 is likely what will occur in practice.   it feels a little awkward for an attribute set operation to move forward with a transactional modification to the database server.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.python.org/pipermail/db-sig/attachments/20221028/a1ddaac4/attachment.html>


More information about the DB-SIG mailing list