public inbox for [email protected]
help / color / mirror / Atom feedFrom: Karsten Hilbert <[email protected]>
To: Daniele Varrazzo <[email protected]>
To: Paolo De Stefani <[email protected]>
To: Psycopg <[email protected]>
Subject: Re: psycopg3 transactions
Date: Sun, 17 Oct 2021 00:58:48 +0200
Message-ID: <YWtZKL1nVM/[email protected]> (raw)
In-Reply-To: <YWtWyC/[email protected]>
References: <[email protected]>
<CA+mi_8bXjHTrzDLQ+n_6K2MHVsr0J32X1HA28Ey9O+-Zm6JaeQ@mail.gmail.com>
<[email protected]>
<CA+mi_8afF2jMifiLSvL99+Ztupy1me7xDNAv0g47WxHWbwN9vw@mail.gmail.com>
<[email protected]>
<CA+mi_8ZJy5yHovbjBhevWLhm9b3RH67qD+_5Mk+trfb1-Z19jQ@mail.gmail.com>
<CA+mi_8ZvfQ3ndZDrRFX1XCfMyGLhkp5ZVq4Y92iZe4nxtkw_Yw@mail.gmail.com>
<YWtWyC/[email protected]>
Am Sun, Oct 17, 2021 at 12:48:40AM +0200 schrieb Karsten Hilbert:
> > https://www.psycopg.org/psycopg3/docs/basic/transactions.html
>
> I am sorry to say this but this concept:
>
> This way we don’t have to remember to call neither
> close() nor commit() and the database operation have
> actually a persistent effect.
>
> seems fundamentally flawed to me in terms of databases.
> Actually changing the content of a database should be a
> conscious decision by program(mer) logic.
I could, perhaps, agree with the *transaction* context
manager being default-commit because:
- after the context block the transaction has gone away
- hence what happens inside either failed (auto-rollback)
- or is to be committed
Not so for the *connection* context manager.
Best,
Karsten
--
GPG 40BE 5B0E C98E 1713 AFA6 5BC0 3BEA AC80 7D4F C89B
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]
Subject: Re: psycopg3 transactions
In-Reply-To: <YWtZKL1nVM/[email protected]>
* 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