Search Postgresql Archives

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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Dec 7, 2009 at 4:00 PM, Dan Kortschak
<dan.kortschak@xxxxxxxxxxxxxxx> 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.

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux