pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andrew McMillan <andrew@catalyst.net.nz>
To: miguel@ipatimup.pt
Cc: pgsql-php@postgresql.org
Subject: Re: PHP die but PG doesnt have roolbacked the transaction
Date: 17 Apr 2002 22:47:45 +1200
Message-ID: <1019040465.20774.622.camel@kant.mcmillan.net.nz> (raw)
In-Reply-To: <1207.213.30.9.100.1018999292.squirrel@www.ipatimup.pt>
References: <1207.213.30.9.100.1018999292.squirrel@www.ipatimup.pt>

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?




view thread (2+ messages)

Message-ID: <1019040465.20774.622.camel@kant.mcmillan.net.nz>
Permalink:  ../1019040465.20774.622.camel@kant.mcmillan.net.nz/
Also on:    postgresql.org/message-id/1019040465.20774.622.camel@kant.mcmillan.net.nz

 · 

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-php@postgresql.org
  Cc: andrew@catalyst.net.nz, miguel@ipatimup.pt
  Subject: Re: PHP die but PG doesnt have roolbacked the transaction
  In-Reply-To: <1019040465.20774.622.camel@kant.mcmillan.net.nz>
  References: <1207.213.30.9.100.1018999292.squirrel@www.ipatimup.pt> <1019040465.20774.622.camel@kant.mcmillan.net.nz>

* 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