X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id E83B13A1ADE for ; Fri, 14 Jan 2005 16:42:42 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 88380-01 for ; Fri, 14 Jan 2005 16:42:34 +0000 (GMT) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by svr1.postgresql.org (Postfix) with ESMTP id BC9533A1AC3 for ; Fri, 14 Jan 2005 16:42:31 +0000 (GMT) Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.11/8.12.11) with ESMTP id j0EGgUg5001609 for ; Fri, 14 Jan 2005 11:42:30 -0500 Received: from mail.boston.redhat.com (mail.boston.redhat.com [172.16.76.12]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id j0EGgUr09613 for ; Fri, 14 Jan 2005 11:42:30 -0500 Received: from localhost.localdomain (sebastian-int.corp.redhat.com [172.16.52.221]) by mail.boston.redhat.com (8.12.8/8.12.8) with ESMTP id j0EGgRiS011556 for ; Fri, 14 Jan 2005 11:42:28 -0500 From: Vadim Nasardinov Organization: Red Hat / Westford To: pgsql-jdbc@postgresql.org Subject: Re: Weird behavior in transaction handling (Possible bug ?) Date: Fri, 14 Jan 2005 11:42:54 -0500 User-Agent: KMail/1.7 References: <20050114161304.32600.qmail@web14223.mail.yahoo.com> <41E7F207.6050409@fastcrypt.com> In-Reply-To: <41E7F207.6050409@fastcrypt.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200501141142.54170@vadim.nasardinov> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.05 tagged_above=0 required=5 tests=AWL, FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200501/121 X-Sequence-Number: 12001 On Friday 14 January 2005 11:23, Dave Cramer wrote: > With postgres once an error occurs in a transaction block you need > to rollback. None of the transaction will commit. > > This behaviour makes sense as it assumes that the transaction block > is atomic and it should all succeed or all fail. For completeness sake, it should be mentioned that Oracle's way of dealing with this is no less sensible. Oracle's transactions are atomic in the sense that all of the statements that did not raise an error are committed atomically. If any of the statements fail, it's up to the application programmer to decide whether or not it makes sense to continue with the remaining statements. This question pops up frequently. Here's a random example: http://archives.postgresql.org/pgsql-advocacy/2004-03/threads.php#00067