Aw: Re: psycopg3 transactions

2021-10-21 Thread Karsten Hilbert
> The behaviour of a dbapi connection, without context block, is to just close > the communication. The fact that this results in a rollback > stems only from > the behaviour of the server But that's the whole point? A driver should _not_ (by default) alter the default behaviour of the other

Aw: Re: psycopg3 transactions

2021-10-14 Thread Karsten Hilbert
>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 ro