LOCK TABLE HELP

Поиск
Список
Период
Сортировка
От luca.ciciriello@email.it
Тема LOCK TABLE HELP
Дата
Msg-id 9829913a05e439e17adf80ce24d98f98@85.18.140.153
обсуждение исходный текст
Ответы Re: LOCK TABLE HELP  (Richard Huxton <dev@archonet.com>)
Re: LOCK TABLE HELP  (Craig Ringer <craig@postnewspapers.com.au>)
Список pgsql-general
Hi All.

I'm using for the first time the postgres lock utilities, but brobably I'm doing something of not legal.

My action are:

void *Execute(void *pParam)
{
....................................... .
........................................

        string tableLock = "BEGIN WORK;"; 
        tableLock.append(" LOCK TABLE "); 
        tableLock.append(actorTable); 
        tableLock.append(" IN ACCESS EXCLUSIVE MODE;"); 
     &nbs p;  res = PQexec(connection, tableLock.c_str());

........................................
........................................

pObj->ReturnNotification(static_cast<string>(notify->relname),connection) ;

.........................................
.........................................

CleanUpBeforeStop(void *pParam);
}

void CleanUpBeforeStop(void *pParam)
{
.........................................
.........................................

res = PQexec(pPti->conn, "COMMIT WORK;");
}

Well, the function Execute is the detached procedure of a thread. In here I execute the LOCK command on the table "actorTable". Then, in the method ReturnNotification I read the locked table. At last, calling the function CleanUpBeforeStop, I execute the COMMIT command.

Well, all this doesn't work (the connection is the always the same in all methods and functions). Have I to L ock the table, perform some operation on this table, and unlock the table all in the same function scope? 

Any Idea?

Thanks in advance.

Luca

----
Email.it, the professional e-mail, gratis per te: clicca qui

Sponsor:
Una BMW Z4 Roadster a 10€? Prova gratis su Bidplaza.it!
Clicca qui

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

Предыдущее
От: Clodoaldo
Дата:
Сообщение: Re: Reindex does not finish 8.2.6
Следующее
От: Adrian Klaver
Дата:
Сообщение: Re: GRANT giving error on sequence in 7.4.19