Received: from heidegger.catalyst.net.nz (203-79-74-75.adsl.paradise.net.nz [203.79.74.75]) by postgresql.org (Postfix) with ESMTP id 1EB2547587E for ; Wed, 17 Apr 2002 06:48:33 -0400 (EDT) Received: from 127.0.0.1 (ident=unknown) by heidegger.catalyst.net.nz with esmtp (MasqMail 0.1.16) id 16xmyX-5s7-00; Wed, 17 Apr 2002 22:47:45 +1200 Subject: Re: PHP die but PG doesnt have roolbacked the transaction From: Andrew McMillan To: miguel@ipatimup.pt Cc: pgsql-php@postgresql.org In-Reply-To: <1207.213.30.9.100.1018999292.squirrel@www.ipatimup.pt> References: <1207.213.30.9.100.1018999292.squirrel@www.ipatimup.pt> Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Mailer: Ximian Evolution 1.0.3 Date: 17 Apr 2002 22:47:45 +1200 Message-Id: <1019040465.20774.622.camel@kant.mcmillan.net.nz> Mime-Version: 1.0 X-Archive-Number: 200204/37 X-Sequence-Number: 1061 On Wed, 2002-04-17 at 11:21, Miguel Carvalho wrote: > Hi, > > for the subject you are seeing what is my problem, but i will give some > more info. > > PHP version: 4.1.2 > OS: Linux, Suse 7 > PG version: 7.1.2 > > A PHP script has die with an error( a typo ) saying something like this: > > missing parameter 1 for funcion my_function ... > > As far as i know, when a connection to a database is lost( i use pg_connect > ) and the database server is executing in NOT auto commit mode( using > transactions ), the transaction is roolbacked enterely. Isnt this right? > > Question: Why does the transaction doesnt got roobacked? > > Is this a bug in PHP? > Is this a bug in PG? I'm betting that the error is in your script, although there are PG versions quite a lot newer than that one (7.2.1 is current). How do you specify 'not autocommit mode' within your script? In my PHP programs I explicitly do a "BEGIN" when I want a transaction to start, and a "COMMIT" when I want it to end (or "ROLLBACK", of course). If I don't use a BEGIN, then each statement will be committed straight away. I am not attempting to turn off auto-commit at all, but transaction scoping does work correctly. Perhaps you could work around by leaving everything at it's defaults and explicitly scoping the transaction? Regards, Andrew. -- -------------------------------------------------------------------- Andrew @ Catalyst .Net.NZ Ltd, PO Box 11-053, Manners St, Wellington WEB: http://catalyst.net.nz/ PHYS: Level 2, 150-154 Willis St DDI: +64(4)916-7201 MOB: +64(21)635-694 OFFICE: +64(4)499-2267 Are you enrolled at http://schoolreunions.co.nz/ yet?