Re: how to ensure a client waits for a previous transaction to finish?

Поиск
Список
Период
Сортировка
От Vick Khera
Тема Re: how to ensure a client waits for a previous transaction to finish?
Дата
Msg-id 2968dfd60912071325s7864029ewb15c00c6374123fb@mail.gmail.com
обсуждение исходный текст
Ответ на how to ensure a client waits for a previous transaction to finish?  (Dan Kortschak <dan.kortschak@adelaide.edu.au>)
Список pgsql-general
On Mon, Dec 7, 2009 at 4:00 PM, Dan Kortschak
<dan.kortschak@adelaide.edu.au> wrote:
> During manual testing everything works, but automating it results in the
> query scripts starting before the population transactions having
> completed, so they give erroneous result.
>

Update your process to have the query scripts wait until the
population scripts are done.  Either that or have the populate script
LOCK TABLE the first table that the query is going to use, and it will
automatically block until your transaction is complete for populating.

But really, it sounds like you have a process coordination problem,
not a database problem.

Hmmm.... you could use the DB to synchronize by having the query
program LISTEN for an event and wait until that arrives, then have the
populating program NOTIFY that event once it is done.  Just select()
on the Pg socket on the query program and once it is ready to read,
check for any NOTIFY events that may have come.

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

Предыдущее
От: Dan Kortschak
Дата:
Сообщение: Re: how to ensure a client waits for a previous transaction to finish?
Следующее
От: John R Pierce
Дата:
Сообщение: Re: how to ensure a client waits for a previous transaction to finish?