DeadLocks...

Поиск
Список
Период
Сортировка
От
Тема DeadLocks...
Дата
Msg-id Whfp99GX.1181830164.4231220.tom@tacocat.net
обсуждение исходный текст
Ответы Re: DeadLocks..., DeadLocks...  (Gregory Stark <stark@enterprisedb.com>)
Re: DeadLocks...  (Scott Marlowe <smarlowe@g2switchworks.com>)
Список pgsql-general
I found a problem with my application which only occurs under high loads
(isn't that always the case?).

snippets of perl...

insert into tokens (token)
select values.token
from (values TOKEN_LIST_STRING) as values(token)
left outer join tokens t using (token)
where t.token_idx is null

$sql =~ s/TOKEN_LIST_STRING/$string/
where $string is of the form (('one'),('two'))

This works 99% of the time.

But everyone once in a long while it seems that I hit simultaneaous
execute() statements that deadlock on the insertion.

Right now I know of no other way to handle this than to eval{ } the
execution and if it fails, sleep random milliseconds and retry... "wash
rinse repeat" for some number of times.

Is there any better way of doing this or some other means to manage
DEADLOCK?

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

Предыдущее
От: g.hintermayer@inode.at
Дата:
Сообщение: Re: precision of epoch
Следующее
От: Gregory Stark
Дата:
Сообщение: Re: DeadLocks..., DeadLocks...