Rlock() & isrlocked() mystery  
Author Message
sysadminnewbie





PostPosted: Wed Jan 24 14:04:43 CST 2007 Top

Exchange Servers >> Rlock() & isrlocked() mystery

I have some code & results that I'm at a loss to explain. The code looks
like

if rlock()
xx = isrlocked()
dostuff()
endif

xx is always .f.

...can't figure it at all

Exchange Server30  
 
 
Bernhard





PostPosted: Wed Jan 24 14:04:43 CST 2007 Top

Exchange Servers >> Rlock() & isrlocked() mystery Hi Lew,

> I have some code & results that I'm at a loss to explain. The code looks
> like
>
> if rlock()
> xx = isrlocked()
> dostuff()
> endif
>
> xx is always .f.

If the table is used exclusively, isRLocked() always returns .F. while rlock()
always returns .T.

Regards
Bernhard Sander
 
 
Lew





PostPosted: Wed Jan 24 15:19:41 CST 2007 Top

Exchange Servers >> Rlock() & isrlocked() mystery What about if the current *record* is rlocked(), but the table is used
shared? I use isExclusive() for tables.



> Hi Lew,
>
>> I have some code & results that I'm at a loss to explain. The code looks
>> like
>>
>> if rlock()
>> xx = isrlocked()
>> dostuff()
>> endif
>>
>> xx is always .f.
>
> If the table is used exclusively, isRLocked() always returns .F. while
> rlock() always returns .T.
>
> Regards
> Bernhard Sander


 
 
Lew





PostPosted: Wed Jan 24 15:40:34 CST 2007 Top

Exchange Servers >> Rlock() & isrlocked() mystery It wasn't a table after all, it was a ro cursor.



> Hi Lew,
>
>> I have some code & results that I'm at a loss to explain. The code looks
>> like
>>
>> if rlock()
>> xx = isrlocked()
>> dostuff()
>> endif
>>
>> xx is always .f.
>
> If the table is used exclusively, isRLocked() always returns .F. while
> rlock() always returns .T.
>
> Regards
> Bernhard Sander


 
 
Man-wai





PostPosted: Wed Jan 24 21:23:57 CST 2007 Top

Exchange Servers >> Rlock() & isrlocked() mystery
> It wasn't a table after all, it was a ro cursor.

You could make a read-only cursor readable by

select 0
use dbf(old_cursor_alias) again shared alias new_alias
use in (old_cursor_alias)

--
iTech Consulting Co., Ltd.
Specialized in providing ePOS solutions
Website: http://www.itech.com.hk (IE only)
Tel: (852) 2325 3883 Fax: (852)2325 8288
 
 
Bernhard





PostPosted: Thu Jan 25 03:27:45 CST 2007 Top

Exchange Servers >> Rlock() & isrlocked() mystery Hi Man-wai Chang,

> You could make a read-only cursor readable by
Readable and exclusive are very different things...

Regards
Bernhard Sander
 
 
Bernhard





PostPosted: Thu Jan 25 03:30:08 CST 2007 Top

Exchange Servers >> Rlock() & isrlocked() mystery Hi Lew,

> It wasn't a table after all, it was a ro cursor.
with your cursor loaded, have a look at the status bar. It tells: "Exclusive".
So, no wonder why isrlocked() returns the surprising value.

Regards
Bernhard Sander