Re: what happens if a failed transaction is not rolled back?

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Siddharth Jain <siddhsql(at)gmail(dot)com>
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: what happens if a failed transaction is not rolled back?
Date: 2023-04-24 15:46:49
Message-ID: CAKFQuwZLqqiwmNjzO=RxztMqTQ+FBu8ti9p0Gb00ZS7iW4tM7w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, Apr 24, 2023 at 8:37 AM Siddharth Jain <siddhsql(at)gmail(dot)com> wrote:

> Hi All,
>
> i understand when writing application code, we should rollback a
> transaction that fails to commit. this is typically done in the catch block
> of a try-catch exception handler. but what if the developer does not
> rollback the transaction? what happens in that case?
>
> note that i am not asking: what happens if a transaction is not rolled
> back?
> i am asking: what happens if a *failed* transaction is not rolled back?
>
> failed transaction = you try to commit it but get an exception back from
> the database.
>
>
There isn't anything special about a failed transaction compared to any
other transaction that you leave open.

Might help to describe what the application does with the connection
subsequent to the point of attempted commit.

David J.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Garfield Lewis 2023-04-24 15:50:04 Re: [EXT] Re: SCROLLABLE/UPDATABLE cursor question
Previous Message Adrian Klaver 2023-04-24 15:45:03 Re: what happens if a failed transaction is not rolled back?