Re: concurrent updates problem

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: concurrent updates problem
Дата
Msg-id 19686.985018622@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: concurrent updates problem  (mwaples@waples.net)
Список pgsql-general
mwaples@waples.net writes:
> Im using aolserver - but its Im writing it in php later too.
> code is below

> set sql "BEGIN WORK"
> ns_db exec $db $sql

> set sql "SET TRANSACTION ISOLATION LEVEL SERIALIZABLE"
> ns_db exec $db $sql

> set sql "UPDATE threads set views = views + 1 WHERE forum_id = $forum_id
> AND thread_id = $thread_id"
> ns_db dml $db $sql

> set sql "COMMIT WORK"
> ns_db exec $db $sql

Are you sure that ns_db exec isn't "helpfully" doing a commit after each
command?

> But 5 or 6 concurrent requests always produce the correct results, any
> more than that things go wrong.

Sounds like you might be running into some sort of number-of-concurrent-
connections limit in AOLserver.  I'm not sure what happens when there
are too many threads for the available number of database connections in
AOLserver, but this example suggests that it's not good.  Anyone know?

            regards, tom lane

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: concurrent updates problem
Следующее
От: Lamar Owen
Дата:
Сообщение: Re: Cant connect if -B 1024 was set to postmaster