| От | Matt Miller |
|---|---|
| Тема | Re: Waiting on a transaction |
| Дата | |
| Msg-id | 1124219944.3714.39.camel@dbamm01-linux обсуждение исходный текст |
| Ответ на | Re: Waiting on a transaction (Bill Moseley <moseley@hank.org>) |
| Ответы |
Re: Waiting on a transaction
|
| Список | pgsql-general |
On Tue, 2005-08-16 at 12:01 -0700, Bill Moseley wrote: > I wondered if my application should set an alarm and timeout > with an error if, by odd chance, an update hangs. Here's a way to handle this under the upcoming 8.1 release: Before you execute the update you can execute SELECT ... FOR UPDATE NOWAIT to select anything (e.g. dummy constant) from the row that you want to update. If no error is thrown then you have a lock on your row and you can confidently proceed with your update. Otherwise someone has that row locked. At that point you can loop and retry if you want.
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера