Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id EBB679FBD79 for ; Thu, 1 Mar 2007 09:40:14 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-new, port 10024) with ESMTP id 61305-02 for ; Thu, 1 Mar 2007 09:40:06 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from a2s5.a2hosting.com (a2s5.a2hosting.com [209.124.50.10]) by postgresql.org (Postfix) with ESMTP id DF5B69FBD25 for ; Thu, 1 Mar 2007 09:40:11 -0400 (AST) Received: from adsl-155-107-212.tys.bellsouth.net ([72.155.107.212] helo=[192.168.1.12]) by a2s5.a2hosting.com with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.63) (envelope-from ) id 1HMlVy-0005Ec-Gf; Thu, 01 Mar 2007 08:40:10 -0500 In-Reply-To: References: <20070301131523.fgfm83nb9y2kgo4c@imp3.uta.fi> Mime-Version: 1.0 (Apple Message framework v752.3) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <59D024F7-8F90-4FD0-B8A9-A58C85CC014F@pgedit.com> Cc: pgsql-php@postgresql.org Content-Transfer-Encoding: 7bit From: John DeSoi Subject: Re: transactions from PHP - double COMMIT required? Date: Thu, 1 Mar 2007 08:40:06 -0500 To: mikie X-Mailer: Apple Mail (2.752.3) X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - a2s5.a2hosting.com X-AntiAbuse: Original Domain - postgresql.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - pgedit.com X-Source: X-Source-Args: X-Source-Dir: X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200703/10 X-Sequence-Number: 3722 The client must issue a command to commit or rollback the transaction. In your example, are you sending all of the SQL lines (including the COMMIT) as a single execution? It sounds like the interface stops executing as soon as an error is reached. So perhaps change your code to execute the COMMIT separately after all the other commands have executed. John On Mar 1, 2007, at 7:45 AM, mikie wrote: > Yes, that is nice way to work with databases, but I am on PHP4 and I > am not using the PDO. > But getting back to my problem - perhaps there is something I > misunderstood: is it the client application responsibility to check if > the transaction failed or succeeded and issue COMMIT or ROLLBACK > accordingly (how do I close the transaction block in that case)? > Or is it the database server that is suppose to check if transaction > succeded and perform the query, or ROLLBACK if anything went wrong? John DeSoi, Ph.D. http://pgedit.com/ Power Tools for PostgreSQL