| От | Ottavio Campana |
|---|---|
| Тема | concurrency in stored procedures |
| Дата | |
| Msg-id | 46041F3A.2030707@campana.vi.it обсуждение исходный текст |
| Ответы |
Re: concurrency in stored procedures
|
| Список | pgsql-general |
Hi, using constraints on tables I was able to remove some race conditions, because the unique index prevents the same data to be inserted twice into the table. But I still didn't fix all the race conditions, because in some functions I have to modify more than one table or I just have read and write data in the same table. So, what is the best way to handle concurrency in stored procedures? I read that using locks isn't good because it may lead to deadlocks, so I was thinking about transactions, but I wan't able to find a good example. What would you to in order to be sure that one function or a part of it is atomically executed? I also read that postgresql is able to detect deadlocks and can try to solve them. How does this happen in a stored procedure and how can a procedure know that it was aborted because of the deadlock? Thank you -- Non c'e' piu' forza nella normalita', c'e' solo monotonia.
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера