Re: PHP die but PG doesnt have roolbacked the transaction

From: Andrew McMillan <andrew(at)catalyst(dot)net(dot)nz>
To: miguel(at)ipatimup(dot)pt
Cc: pgsql-php(at)postgresql(dot)org
Subject: Re: PHP die but PG doesnt have roolbacked the transaction
Date: 2002-04-17 10:47:45
Message-ID: 1019040465.20774.622.camel@kant.mcmillan.net.nz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-php

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?

In response to

Browse pgsql-php by date

  From Date Subject
Next Message Alexander Pucher 2002-04-17 11:04:40 php-postgresql-application
Previous Message Jean-Michel POURE 2002-04-17 09:49:13 Re: Unicode Secret