List:General Discussion« Previous MessageNext Message »
From:John Comerford Date:September 14 2007 12:44am
Subject:Lock is Always Free
View as plain text  
Hi Folks,

I am having problems trying to use the GET_LOCK and IS_FREE_LOCK 
commands.  I am trying to put together a queue manager.  The theory is 
that is would scan for queues, check for a lock and if the lock if free 
then start the queue.  When the queue process starts it should use 
GET_LOCK to acquire a lock so that when the queue manager does another 
pass IS_FREE_LOCK would return false and the manager would know the 
queue is running.  Also if the queue dies, the lock would be released 
and the manager could restart it.

My problem is that the IS_FREE_LOCK always returns true. 

I have done some testing with two instances of the Query Browser 
running.  In one I execute:
    SELECT GET_LOCK('testing',10)
 > 1

In the second I execute :
  SELECT IS_FREE_LOCK('testing');
 > 1

Maybe I have misinterpreted the scope of the lock functions, my 
understanding was that the GET_LOCK should create a lock and the lock 
should remain until a RELEASE_LOCK command is issued or the process that 
created it terminates, is this correct ?  If this is true anybody got 
any ideas why the IS_FREE_LOCK is always true ?

Lock is Always FreeJohn Comerford14 Sep
  • Re: Lock is Always FreeBaron Schwartz17 Sep