[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 12:36:05 EDT 2022



On Fri, Oct 28, 2022, at 12:14 PM, Marc-Andre Lemburg wrote:
> 
> Overall, I believe that important settings such as autocommit
> should only be set in the connection constructor, since the
> semantics change dramatically between autocommit and manual
> commit.

oh, that change would be much more intrusive.   This defeats the usability of connection pools, and being able to reset session state on a connection so that it may be returned to a pool for re-use is a normal thing.  Within the MS ODBC realm Ive just learned of the sp_reset_connection stored procedure, which seems to be sparsely documented, but is mentioned as essential for pooling here:  
https://learn.microsoft.com/en-us/sql/connect/odbc/linux-mac/using-integrated-authentication?view=sql-server-ver16#tracking-access-to-a-database





> 
> In such a world, we'd only have an autocommit keyword argument
> in the Connection constructor and a read-only attribute on the
> object to query this after creation.
> 
> Such a change could be implemented for a DB-API 3.0. For 2.0,
> the ship has sailed already.
> 
> So how about going with the above compromise (*) ?
> 
> -- 
> Marc-Andre Lemburg
> eGenix.com
> 
> Professional Python Services directly from the Experts (#1, Oct 28 2022)
> >>> Python Projects, Coaching and Support ...    https://www.egenix.com/
> >>> Python Product Development ...        https://consulting.egenix.com/
> ________________________________________________________________________
> 
> ::: We implement business ideas - efficiently in both time and costs :::
> 
>     eGenix.com Software, Skills and Services GmbH  Pastor-Loeh-Str.48
>      D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg
>             Registered at Amtsgericht Duesseldorf: HRB 46611
>                 https://www.egenix.com/company/contact/
>                       https://www.malemburg.com/
> 
> 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.python.org/pipermail/db-sig/attachments/20221028/ee70f524/attachment.html>


More information about the DB-SIG mailing list