Path: ...!weretis.net!feeder9.news.weretis.net!feeder8.news.weretis.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Lawrence D'Oliveiro Newsgroups: comp.lang.python Subject: Re: psycopg2 positioning of .commit() (Posting On Python-List Prohibited) Date: Mon, 9 Sep 2024 21:16:09 -0000 (UTC) Organization: A noiseless patient Spider Lines: 20 Message-ID: References: <7cb50df2-9c76-477f-91c9-e149c7637104@aklaver.com> <5ee80b84-f04b-454d-ab39-45572e0751a1@aklaver.com> <4a1b12fc-24b7-4c7e-b1f2-6ec9c5f341c2@aklaver.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Injection-Date: Mon, 09 Sep 2024 23:16:09 +0200 (CEST) Injection-Info: dont-email.me; posting-host="48619980776be9ad3edbc43d1fdbfd55"; logging-data="2688396"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19nGnKeQoUIxCGfsQJFwGI2" User-Agent: Pan/0.160 (Toresk; ) Cancel-Lock: sha1:JGP+1dIhV52N/P1FUAnABTe8tnc= Bytes: 2367 On Mon, 9 Sep 2024 21:12:51 -0000 (UTC), Jon Ribbens wrote: > On 2024-09-09, Lawrence D'Oliveiro wrote: >> >> On Mon, 9 Sep 2024 10:00:11 -0000 (UTC), Jon Ribbens wrote: >>> >>> On 2024-09-09, Lawrence D'Oliveiro wrote: >>>> >>>> The database only needs to commit when it is explicitly told. >>>> Anything less -- no commit. >>> >>> So the Python code is half-way through a transaction when it throws a >>> (non-database-related) exception and that thread of execution is >>> aborted. The database connection returns to the pool ... >> >> The DBMS connection is deleted. > > How does that happen then? You write code to do it.