pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
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: Wed, 13 May 2020 08:15:40 -0700
Message-ID: <bbf09998-7761-0aed-a155-a4d611048b36@aklaver.com> (raw)
In-Reply-To: <20200513053405.GB26063@sh4-5.1blu.de>
References: <20200512145352.GA32335@sh4-5.1blu.de>
	<23100.1589298880@sss.pgh.pa.us>
	<20200512191429.GB32335@sh4-5.1blu.de>
	<9dbc6477-f9a2-b62a-e011-0983fe150741@aklaver.com>
	<20200512235207.GA3420@sh4-5.1blu.de>
	<dea15286-0856-f713-387e-062e98ae975c@aklaver.com>
	<20200513053405.GB26063@sh4-5.1blu.de>

On 5/12/20 10:34 PM, Matthias Apitz wrote:
> 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.


In your original post you had:

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

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

You then included a sequence of log messages that ended with a 
"rollback". Within that sequence was the INSERT to swd_auftrag. It 
seemed reasonable to ask whether that INSERT rolled back also. That is 
if the intent of this thread is to figure out why the INSERT was rolled 
back. If the thread has changed to fixing ESQL/C logging then ignore the 
above.

> 
> 	matthias
> 
> 


-- 
Adrian Klaver
adrian.klaver@aklaver.com





view thread (16+ messages)  latest in thread

Message-ID: <bbf09998-7761-0aed-a155-a4d611048b36@aklaver.com>
Permalink:  ../bbf09998-7761-0aed-a155-a4d611048b36@aklaver.com/
Also on:    postgresql.org/message-id/bbf09998-7761-0aed-a155-a4d611048b36@aklaver.com

 · 

reply

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: <bbf09998-7761-0aed-a155-a4d611048b36@aklaver.com>
  References: <20200512145352.GA32335@sh4-5.1blu.de> <23100.1589298880@sss.pgh.pa.us> <20200512191429.GB32335@sh4-5.1blu.de> <9dbc6477-f9a2-b62a-e011-0983fe150741@aklaver.com> <20200512235207.GA3420@sh4-5.1blu.de> <dea15286-0856-f713-387e-062e98ae975c@aklaver.com> <20200513053405.GB26063@sh4-5.1blu.de> <bbf09998-7761-0aed-a155-a4d611048b36@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