Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jYWcY-00088L-ND for pgsql-general@arkaria.postgresql.org; Tue, 12 May 2020 15:15:02 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jYWcU-0001ac-Qg for pgsql-general@arkaria.postgresql.org; Tue, 12 May 2020 15:14:58 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jYWcU-0001Zg-Iu for pgsql-general@lists.postgresql.org; Tue, 12 May 2020 15:14:58 +0000 Received: from out4-smtp.messagingengine.com ([66.111.4.28]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jYWcS-0006HL-Hi for pgsql-general@lists.postgresql.org; Tue, 12 May 2020 15:14:58 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 24E505C01DF; Tue, 12 May 2020 11:14:55 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Tue, 12 May 2020 11:14:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= subject:to:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm2; bh=2 vouUNsXSSHFgZ7BNAQjqtaKAQzGNkiOtFV0zpGZCkw=; b=WYiJ9YM8MBq2t02u5 iP6QTWzHYZAvLnxnN8yhlyeGrJJPwM9IrwbwPNMiD/xX7HIAlV3ymZRVzpYtpMTf uoFWaqRqvwaLoIAO41ndCSaX/PkjiId++xxY7cTyoHA28LKMu7JOtUThG3plB7bK IJAgBHQwAAxhPIHyCp27cvgKbKWO9paSCw+BLCqEziPAMyZzZMVmX7KYS59BhsNp UP3jPdYtwq9GDnxAZBC7cakkDZFQAxvAG1NaW94BxnxyIcMH/dfnp2C0szCNYMXV J2LmAwApATr1eMa4iR4UgFq2gt9hDYkjxgFmZOmQCMs15X0gH0tJeiVPa9lvTOBz zSXpQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=2vouUNsXSSHFgZ7BNAQjqtaKAQzGNkiOtFV0zpGZC kw=; b=hUHXB7QcbqNj4dmh/QcYzEb8nGdktUA0LqsDCjoveNE/gpQUkSrw77Od1 pJk3soXQX2p+qvMlgGyoZzcQqoie4/swoIU7yxKg5D3ggNDtUF/BTqcmV5tKbyua Gt6zyJQrr28cWZJ1d7t+osyzZexYDse+tYRuFFIpdOLyoOZgW0Rcss+S6HdH72Ie 44sB3VXcxfp26o/Jjw4bCgJoAqUJ5z8lPrV4p/wNfWjfFlOSO42U/TKdaYiMdWcI 8rui/DsJlPe8IDSFX8EbdmmjzimK65YBL1KNiUE/f9FIJZ24aFe1qqTrsHK2ezb3 SWZ+2kEl4ohM4geaAzhdBsTA3MAJA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedrledvgdekgecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhepuffvfhfhkffffgggjggtgfesthejre dttdefjeenucfhrhhomheptegurhhirghnucfmlhgrvhgvrhcuoegrughrihgrnhdrkhhl rghvvghrsegrkhhlrghvvghrrdgtohhmqeenucggtffrrghtthgvrhhnpeetjedvteffje euvdelieeffeehuedthffgvdfhhffhkedvudevgedvjedufefgveenucfkphepjeehrddu jedvrdehrddvfedunecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilh hfrhhomheprggurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtghomh X-ME-Proxy: Received: from [192.168.1.3] (75-172-5-231.tukw.qwest.net [75.172.5.231]) by mail.messagingengine.com (Postfix) with ESMTPA id 3FCFB3280060; Tue, 12 May 2020 11:14:54 -0400 (EDT) Subject: Re: ESQL/C: a ROLLBACK rolls back a COMMITED transaction To: Matthias Apitz , pgsql-general@lists.postgresql.org References: <20200512145352.GA32335@sh4-5.1blu.de> From: Adrian Klaver Message-ID: Date: Tue, 12 May 2020 08:14:53 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: <20200512145352.GA32335@sh4-5.1blu.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk 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