Python DB API - commit() v. execute("commit transaction")?

Jon Ribbens jon+usenet at unequivocal.eu
Tue May 30 09:42:14 EDT 2017


On 2017-05-30, Skip Montanaro <skip.montanaro at gmail.com> wrote:
> Assuming the underlying database supports transactions, is there any
> difference between calling the commit() method on the connection and
> calling the execute method on the cursor with the "commit transaction"
> statement? It seems a bit asymmetric to me to start a transaction with
>
>   cur.execute("begin transaction")
>
> but end it with
>
>   conn.commit()

Yes, I found this most peculiar.



More information about the Python-list mailing list