Re: libpq program SELECT FOR UPDATE and TIMEOUT or CANCEL REQUEST
В списке pgsql-sql по дате отправления:
| От | Bruno Wolff III |
|---|---|
| Тема | Re: libpq program SELECT FOR UPDATE and TIMEOUT or CANCEL REQUEST |
| Дата | |
| Msg-id | 20030523150816.GA3935@wolff.to обсуждение |
| Ответ на | libpq program SELECT FOR UPDATE and TIMEOUT or CANCEL REQUEST (jrpogo@yahoo.com (Jeffrey Pogodzinski)) |
| Список | pgsql-sql |
On Mon, May 19, 2003 at 10:55:23 -0700, Jeffrey Pogodzinski <jrpogo@yahoo.com> wrote: > Hi, > > I am programming using libpq under Linux. > > When I do a "select ... for update" to lock a row, how > would I allow user to cancel or timeout when requesting the > the same row from another program/transaction. You can set statement_timeout. > I do not want the user to have to wait for the update on the > other end. I would rather send the user an error message > saying that the record is LOCKED -- try again later. It is generally bad design to hold database locks while waiting for user input. It is generally better to keep information about updates in a table and have the applications use this information to advise or prevent conncurrent updates to the same data by different people.
В списке pgsql-sql по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера