Re: Adding Connection.autocommit as standard extension to DB-API 2.0 (PEP 249)

"Mike Bayer" <[email protected]> Fri, 28 Oct 2022 10:02:10 -0400
Newsgroups gmane.comp.python.db
Message-ID <[email protected]>
--===============5421692655619056452==
Content-Type: multipart/alternative;
 boundary=38efb0b0e14140b585d3d5bcc59b3a0b

--38efb0b0e14140b585d3d5bcc59b3a0b
Content-Type: text/plain



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.

--38efb0b0e14140b585d3d5bcc59b3a0b
Content-Type: text/html
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE html><html><head><title></title><style type=3D"text/css">p.Mso=
Normal,p.MsoNoSpacing{margin:0}</style></head><body><div><br></div><div>=
<br></div><div>On Fri, Oct 28, 2022, at 9:58 AM, Marc-Andre Lemburg wrot=
e:<br></div><blockquote type=3D"cite" id=3D"qt" style=3D""><div>If there=
 is a pending transaction, though, there are three approaches<br></div><=
div>we could take:<br></div><div><br></div><div>1. The database module r=
aises an exception, to force an explicit<br></div><div>&nbsp;&nbsp;&nbsp=
; .commit() or .rollback() by the programmer.<br></div><div><br></div><d=
iv>2. The module automatically commits the pending transaction,<br></div=
><div>&nbsp;&nbsp;&nbsp; since that's what autocommit is all about.<br><=
/div><div><br></div><div>3. We leave these semantics open and up to the =
database module<br></div><div>&nbsp;&nbsp;&nbsp; to determine.<br></div>=
<div><br></div><div>My preference would be option 2, since this makes th=
ings clear for<br></div><div>everyone and is intuitive (well, at least f=
or me :-)).<br></div></blockquote><div><br></div><div>option 3 is likely=
 what will occur in practice.&nbsp;&nbsp; it feels a little awkward for =
an attribute set operation to move forward with a transactional modifica=
tion to the database server.<br></div><div><br></div></body></html>
--38efb0b0e14140b585d3d5bcc59b3a0b--

--===============5421692655619056452==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
DB-SIG maillist  -  [email protected]
https://mail.python.org/mailman/listinfo/db-sig

--===============5421692655619056452==--