Cannot cancel LOCK TABLE

From: Leon <leon(at)udmnet(dot)ru>
To: "'pgsql-general(at)hub(dot)org'" <pgsql-general(at)postgresql(dot)org>
Subject: Cannot cancel LOCK TABLE
Date: 1999-07-27 14:29:12
Message-ID: 379DC238.429A2E75@udmnet.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi!

There we have a need of canceling LOCK TABLE requests
which fail to lock the table in a given time. Scenario is following:
try to issue a lock on a table, wait for a given time for a completion
ot this lock request, and, if it fails, cancel a lock request and go on
processing other queries. A little experimenting showed that LOCK TABLE
requests cannot be canceled. They just sit in the queue of queries
and don't let other queries to be processed. How can I overcome
that? The piece of code where I try to cancel lock request:

if (difftime(t1,t0) > LOCK_WAIT_TIMEOUT)
{
printf("\nTimeout waiting for lock. Try again.\n");
PQrequestCancel(conn);
PQsendQuery(conn,"rollback");
return 1;
}

--
Leon.
---------
"This may seem a bit weird, but that's okay, because it is weird." -
Perl manpage.

Browse pgsql-general by date

  From Date Subject
Next Message Mike Mascari 1999-07-27 16:41:51 Re: [GENERAL] Problem Compiling C-functions
Previous Message Finn Kettner 1999-07-27 13:45:56 Re: [GENERAL] PHP and Postgresql 6.5.1