Re: PHP die but PG doesnt have roolbacked the transaction

Поиск
Список
Период
Сортировка
От Andrew McMillan
Тема Re: PHP die but PG doesnt have roolbacked the transaction
Дата
Msg-id 1019040465.20774.622.camel@kant.mcmillan.net.nz
обсуждение исходный текст
Ответ на PHP die but PG doesnt have roolbacked the transaction  ("Miguel Carvalho" <miguel@ipatimup.pt>)
Список 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?


В списке pgsql-php по дате отправления:

Предыдущее
От: Jean-Michel POURE
Дата:
Сообщение: Re: Unicode Secret
Следующее
От: Alexander Pucher
Дата:
Сообщение: php-postgresql-application