pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: 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 20:16:21 +0200
Message-ID: <20200513181621.GA5181@sh4-5.1blu.de> (raw)
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>

El día Mittwoch, Mai 13, 2020 a las 08:15:40 -0700, Adrian Klaver escribió:

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

The intention of my original post was to understand why the INSERT was
rolled back. I do know this now: because I overlooked that the cancel of
the transaction was done after the INSERT by CLOSE of a non open CURSOR.

We're fixing this now already by checking in pg_cursors if the CURSOR is
still open before issue the CLOSE. I don't know how expensive this is,
but it seems that there is no other option to check this.

The side step about fixing ESQL/C logging should be handled in another
thread.

Thanks all for your help

	matthias

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





view thread (16+ messages)  latest in thread

Message-ID: <20200513181621.GA5181@sh4-5.1blu.de>
Permalink:  ../20200513181621.GA5181@sh4-5.1blu.de/
Also on:    postgresql.org/message-id/20200513181621.GA5181@sh4-5.1blu.de

 · 

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: guru@unixarea.de
  Subject: Re: ESQL/C: a ROLLBACK rolls back a COMMITED transaction
  In-Reply-To: <20200513181621.GA5181@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> <bbf09998-7761-0aed-a155-a4d611048b36@aklaver.com> <20200513181621.GA5181@sh4-5.1blu.de>

* 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