public inbox for [email protected]
help / color / mirror / Atom feedFrom: Karsten Hilbert <[email protected]>
To: Daniel Fortunov <[email protected]>
Cc: Daniele Varrazzo <[email protected]>
Cc: Paolo De Stefani <[email protected]>
Cc: Psycopg <[email protected]>
Subject: Aw: Re: psycopg3 transactions
Date: Thu, 14 Oct 2021 12:05:03 +0200
Message-ID: <trinity-cf9ddf31-623c-4512-beff-cf6d6d0116b8-1634205902640@3c-app-gmx-bs43> (raw)
In-Reply-To: <CAH1rg6ZoQm=STwMR6AQ_FggxRxUn7qH_tLkRTfJTVYYdbTeL6w@mail.gmail.com>
References: <[email protected]>
<CA+mi_8bXjHTrzDLQ+n_6K2MHVsr0J32X1HA28Ey9O+-Zm6JaeQ@mail.gmail.com>
<[email protected]>
<CA+mi_8afF2jMifiLSvL99+Ztupy1me7xDNAv0g47WxHWbwN9vw@mail.gmail.com>
<CAH1rg6ZoQm=STwMR6AQ_FggxRxUn7qH_tLkRTfJTVYYdbTeL6w@mail.gmail.com>
>My conclusion is that the only sane thing to do is:
>1. Only ever create connections in autocommit mode.
>2. Only ever use `with connection.transaction()` to control transactions.
>3. Forget that `connection.commit()` and `connection.rollback()` exist, and never use them.
What if you need to rollback a hitherto valid transaction ?
Transactions are there for a reason. It seems best to explicitely use them ?
Karsten
view thread (28+ messages) latest in thread
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected], [email protected]
Subject: Re: Aw: Re: psycopg3 transactions
In-Reply-To: <trinity-cf9ddf31-623c-4512-beff-cf6d6d0116b8-1634205902640@3c-app-gmx-bs43>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox