Re: ESQL/C: a ROLLBACK rolls back a COMMITED transaction

From: Matthias Apitz <guru(at)unixarea(dot)de>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: ESQL/C: a ROLLBACK rolls back a COMMITED transaction
Date: 2020-05-13 05:34:05
Message-ID: 20200513053405.GB26063@sh4-5.1blu.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

El día Dienstag, Mai 12, 2020 a las 05:17:33 -0700, Adrian Klaver escribió:

> > > insert into swd_auftrag ..
> > >
> > > COMMIT?
> >
> > This question (if it was a question) I don't understand.
>
> From your original message:
>
> "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."
>
> It was not clear to me whether:
>
> "[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"
>
> also COMMITT(ed) or not?

As I said in the original post of this thread:

[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"
...

i.e. the COMMIT is done in the same connection(!) right after the
INSERT. There is no other ESQL/C call logged (and done) between.

There is only no ACK from the ESQL/C layer about the COMMIT of
ECPGtrans, but this is a fault in the ESQL/C layer code, because the
ECPGtrans is logged before executing it and afterward if it's done OK no
message is generated.

matthias

--
Matthias Apitz, ✉ guru(at)unixarea(dot)de, http://www.unixarea.de/ +49-176-38902045
Public GnuPG key: http://www.unixarea.de/key.pub

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Amine Tengilimoglu 2020-05-13 07:12:47 what is the best way to access cold data on another server?
Previous Message Matthias Apitz 2020-05-13 05:27:31 Re: ESQL/C: a ROLLBACK rolls back a COMMITED transaction