Aw: Re: psycopg3 transactions - Mailing list psycopg

From Karsten Hilbert
Subject Aw: Re: psycopg3 transactions
Date
Msg-id trinity-cf9ddf31-623c-4512-beff-cf6d6d0116b8-1634205902640@3c-app-gmx-bs43
Whole thread Raw
In response to Re: psycopg3 transactions  (Daniel Fortunov <postgresql@danielfortunov.com>)
Responses Re: Re: psycopg3 transactions  (Daniel Fortunov <postgresql@danielfortunov.com>)
List psycopg
>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




psycopg by date:

Previous
From: Reuben Rissler
Date:
Subject: Re: psycopg3 transactions
Next
From: Daniel Fortunov
Date:
Subject: Re: Re: psycopg3 transactions