Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ACK!! The amazing failing RLOCK()
Message
From
27/10/1998 22:17:12
 
 
To
27/10/1998 08:42:17
Tim Hockin
Illinois State U - Residential Computing
Normal, Illinois, United States
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00150675
Message ID:
00151374
Views:
16
>>>It is in a loop for all records. After 496 records, rlock fails. I can not determine why. It is not ISRLOCKED()...each record is UNLOCKed at the end of each loop iteration.....
>>
>>On a Novell Server 3.11 the default, as I recall is 500 locks. This is a Setting that can be changed. I don't know what the default is for 4.* Netware.
>
>hrm, but the loop seems to be unlocking every iteration. Unless the unlock is silently failing - ?
>
>No one else is using this app, I guarantee, since it is on my development system, which is, btw, Netware 4.11 latest everything.
>
>any way I can get more info on what is happening??

Tom, this is a long thread, so someone else may have suggested this...
IF Rlock() or Retrylock()
do stuff
unlock
endif

where Retrylock is a function like (it's an old Fox 2 program of mine)
I don't rely on RLOCK() on it's own to work and I don't call retrylock() first up since it's slower.
FUNCTION RetryLock
PARAMETER cAlias, msg
* Attempt to lock a record and return .T. if successful.
* NOTE: The calling program MUST already have attempted an RLOCK()
* IF RLOCK() OR RetryLock()
*		<replace etc>
* ENDIIF
*
* msg is optional

IF EMPTY(m.cAlias)
	* lock current work area
	cAlias= ALIAS()
ENDIF
IF TYPE('m.msg') # 'C'
	msg= 'The program is currently unable to access a record or file.' ;
		+ 'You can retry now, or cancel and try again later.'
ENDIF

DO WHILE MessageBox(m.msg, 69, 'File/Record in use by another.') = 4
	* User is being persistant!
	IF RLOCK(m.cAlias)
		RETURN .T.
		*<<<<<<<<
	ENDIF
ENDDO
* User has given up hope!
RETURN .F.
That way you'll see if it's failing.
Also check out SET REPROCESS
HTH
Previous
Reply
Map
View

Click here to load this message in the networking platform