Re: Cleaning up aborted transactions

Поиск
Список
Период
Сортировка
От Adrian Tineo
Тема Re: Cleaning up aborted transactions
Дата
Msg-id 003701c32f56$3b8b8c80$926bd9d9@clairvo
обсуждение исходный текст
Ответ на Re: Cleaning up aborted transactions  (Rod Taylor <rbt@rbt.ca>)
Список pgsql-php
Hi Greg

> Just so I have this straight, because I've been wondering the same,
> if someone on my web site does a SELECT and then clicks on the browser
> stop or gets click happy hitting one or many other links on the same
> web page then the 1st SELECT and all other interrupted SELECT's should
> get rolled back if each query starts with a BEGIN; because there is a
> disconnect.  Correct?

I don't let that happen. First, I gather all the required information, then
when the user clicks on submit or whatever he's doing, I do all in one
transaction. If it ends right the user is taken to a screen where he knows
that everything went fine (commit was successfull). If it fails at some
point I send the user to an error page, which can be more or less
descriptive depending on the needs of the interface.

> What about with persistant connections?

I haven't used them as most server out there will have them disabled.
Besides I don't think you need them and is probably not very efficient, also
it could limit the number of users for your app. And it can lead to
unpredictable behaviour on complex websites. If you don't need them, avoid
them.

Adrian Tineo



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

Предыдущее
От: Rod Taylor
Дата:
Сообщение: Re: Cleaning up aborted transactions
Следующее
От: Kurt
Дата:
Сообщение: Groups