taking actions on rollback (PHP)

Поиск
Список
Период
Сортировка
От Ivan Sergio Borgonovo
Тема taking actions on rollback (PHP)
Дата
Msg-id 20080426225212.5755ac66@dawn.webthatworks.it
обсуждение исходный текст
Ответы Re: taking actions on rollback (PHP)
Список pgsql-general
I've a set of statements...

pg_query('begin;');

pg_query('do stuff');
pg_query('do other stuff');

if(!pg_query('commit;')) {
    pg_query('rollback;');
    // DO SOME CLEANUP HERE
}

if something goes wrong the statement actually get rolled back... but
the pg_query('commit;') statement always succede so the cleanup never
get executed.
How am I going to see if the transaction succeeded without checking
what happens for each statement and getting the cleanup code execute?

thanks

--
Ivan Sergio Borgonovo
http://www.webthatworks.it


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Regular expression
Следующее
От: Martijn van Oosterhout
Дата:
Сообщение: Re: taking actions on rollback (PHP)