From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Matthias Apitz <guru@unixarea.de>
To: pgsql-general@lists.postgresql.org
Subject: Re: ESQL/C: a ROLLBACK rolls back a COMMITED transaction
Date: Tue, 12 May 2020 08:14:53 -0700
Message-ID: <b1edd445-b117-ebf1-3b60-2143c6eccdc3@aklaver.com> (raw)
In-Reply-To: <20200512145352.GA32335@sh4-5.1blu.de>
References: <20200512145352.GA32335@sh4-5.1blu.de>
On 5/12/20 7:53 AM, Matthias Apitz wrote:
>
> Hello,
>
> We're facing in our ESQL/C written application a situation where a
> commit'ed INSERT into a table is rolled back. I have here the ESQL/C
> logging of the problem:
>
> ...
> [1471] [12.05.2020 15:48:50:476]: ecpg_execute on line 1744: query: insert into swd_daten ( katkey , aktion , reserv , id , ansetzung , nettodaten ) values ( $1 , $2 , $3 , $4 , $5 , $6 ); with 6 parameter(s) on connection sisis
> [1471] [12.05.2020 15:48:50:476]: ecpg_process_output on line 1744: OK: INSERT 0 1
> [1471] [12.05.2020 15:48:50:477]: ECPGtrans on line 6716: action "commit"; connection "sisis"
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> [1471] [12.05.2020 15:48:50:478]: ecpg_execute on line 1637: query: insert into swd_auftrag ( setnr , aufnum , katkey , userid , seqcount ) values ( $1 , $2 , $3 , $4 , $5 ); with 5 parameter(s) on connection sisis
> [1471] [12.05.2020 15:48:50:478]: ecpg_process_output on line 1637: OK: INSERT 0 1
> [1471] [12.05.2020 15:48:50:478]: ECPGtrans on line 1124: action "commit"; connection "sisis"
> [1471] [12.05.2020 15:48:51:500]: ECPGtrans on line 6716: action "commit"; connection "sisis"
> [1471] [12.05.2020 15:48:51:501]: ECPGtrans on line 1222: action "rollback"; connection "sisis"
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> ...
>
> The INSERT of 1 row into table swd_daten was OK and commit'ed (marked line)
> and a later rollback (last line) seems to roll it back, at least the row
> isn't in the table.
>
> Any ideas? The connection is not set to AUTOCOMMIT.
Hard to tell without seeing the code.
Some things I see:
1) ECPGtrans on line 6716: action "commit"; connection "sisis" occurs twice.
2) ECPGtrans on line 1222: action "rollback"; connection "sisis" Comes
from a line that precedes the INSERT you are interested in. Is there
some sort of nesting going on?
>
> matthias
>
--
Adrian Klaver
adrian.klaver@aklaver.com
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: adrian.klaver@aklaver.com, guru@unixarea.de
Subject: Re: ESQL/C: a ROLLBACK rolls back a COMMITED transaction
In-Reply-To: <b1edd445-b117-ebf1-3b60-2143c6eccdc3@aklaver.com>
References: <20200512145352.GA32335@sh4-5.1blu.de> <b1edd445-b117-ebf1-3b60-2143c6eccdc3@aklaver.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox