Re: transactions from PHP - double COMMIT required?

Поиск
Список
Период
Сортировка
От Martin Marques
Тема Re: transactions from PHP - double COMMIT required?
Дата
Msg-id 45E6E75F.4020408@bugs.unl.edu.ar
обсуждение исходный текст
Ответ на Re: transactions from PHP - double COMMIT required?  (mikie <mikie.pl@gmail.com>)
Ответы Re: transactions from PHP - double COMMIT required?  (mikie <mikie.pl@gmail.com>)
Список pgsql-php
mikie wrote:
>> > 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?
>>
>> PG will rollback all transactions that have an error in some part, as it
>> can't commit the transaction as a whole.
>
> OK, so my way of programming seems correct.
> Then why do I have to send another COMMIT after failed transaction to
> continue with next queries in the same php script ?

I may not have gotten your question right, but with one commit (or end)
is enough. Transaction gets closed (commited or rolled back), and you
can start a new transaction with BEGIN.

--
  21:50:04 up 2 days,  9:07,  0 users,  load average: 0.92, 0.37, 0.18
---------------------------------------------------------
Lic. Martín Marqués         |   SELECT 'mmarques' ||
Centro de Telemática        |       '@' || 'unl.edu.ar';
Universidad Nacional        |   DBA, Programador,
     del Litoral             |   Administrador
---------------------------------------------------------

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

Предыдущее
От: John DeSoi
Дата:
Сообщение: Re: transactions from PHP - double COMMIT required?
Следующее
От: Martin Marques
Дата:
Сообщение: Re: transactions from PHP - double COMMIT required?