[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ShopSuite-dev] NOTIFY tableX, LISTEN tableX, pool Nofities()
From: |
Davi Leal |
Subject: |
[ShopSuite-dev] NOTIFY tableX, LISTEN tableX, pool Nofities() |
Date: |
Thu, 28 Mar 2002 19:24:57 +0100 |
I am developing an n-tier application which uses postgresql 7.2. It has several
windows to show Data Base data. If the DB modifies its data then some or each
window must update the showed information. To realize it the DB send "NOTIFY
<table X changed>".
The problem is that if a window catch a "NOTIFY table1", another window of the
same process, which must update too the table1's information, does not update
due to the asynchronous notification to this backend has already been processed.
Must I use a thread to each application's window?.
Must I do a central collect of notifies and raise the update of windows from
there?. Yes, I think so. :-) However, I need to know the exact type of
notify which the backend gets: "NOTIFY table1", "NOTIFY table2", or ...
How could I differentiate from several types of "NOTIFY tableX" ?.
Which are the fields of the PGnotify* PgDatabase::Notifies() ?.
Note: You can see attached examples as C or C++ code which catch the NOTIFY
from the data base doing a pool. To compile it on Debian GNU/Linux (sid) you
can do:
gcc -o testlibpq2-C testlibpq2.c -I /usr/include/postgresql/ -lpq
g++ -o testlibpq2-C++ testlibpq2.cpp -I /usr/include/postgresql/ -lpq++
Regards,
Davi Leal
testlibpq2.c
Description: Text Data
testlibpq2.cpp
Description: Text Data
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [ShopSuite-dev] NOTIFY tableX, LISTEN tableX, pool Nofities(),
Davi Leal <=