Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Record lock issue
Message
From
16/04/2009 03:06:22
 
 
To
14/04/2009 18:17:04
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
01342876
Message ID:
01395075
Views:
58
Yelena

Thank you also for this option as well.

I have used rlock() in a few other situations for a Cash Receipting application we sell.

The fix Sergey suggested (upgrading to SP1) also seemed to give a noticed
boost in speed just logging into the application, opening files etc...

I may employ both the fix and the suggestion to upgrade in concert - for those who cannot hear.









>Stacy,
>It’s been a while but I think I used LOCK(TRANSFORM(lhistRec),"InvtHist") and it solved the issue.
>
>IF LOCK(<recno>,"Alias Name>)
>   ....
>ELSE
>   ....
>ENDIF
>
>
>
>
>>Yelena
>>
>>Were you able to find a resolution for this problem?
>>
>>I am reproducing the rlock() problem on XP and vista machines with similar code that counts users logged into the app.
>>
>>machine a (xp)
>>- logs in and grabs rlock() on record 1of mytable
>>
>>machine b (vista)
>>- logs in and checks for rlock() on record 1 of mytable
>>- should return .f. and then move to next record
>>
>>Instead of returning .f., machine b hangs until lock on record 1 is released on machine a.
>>
>>It almost appears as though the header of mytable had been locked somehow during the rlock() attempt from machine b.
>>
>>Another person appears to be having a similar issue on MSDN forum:
>>http://social.msdn.microsoft.com/Forums/en-US/visualfoxprogeneral/thread/82dd5a8a-69d3-435e-8dba-c10ce164833b
>>
>>
>>
>>
>>>Table is located on the server. I am not sure if they are running Win 2003 or 2008 server, client machines are Vista.
>>>>Where table is located?
>>>>
>>>>>
>>>>>This issue is really driving me crazy.
>>>>> I have very simple code that runs at the beginning of my application, it calculates number of records that are locked in a table and when it riches the end it will add a new record place a lock on this record and exit. It also might a record which is not locked, then instead adding a new record it will use this record to place a lock.
>>>>>Here is the code
>>>>>
>>>>>SELECT UserCount
>>>>>lnReprocess = SET("REPROCESS")
>>>>>*--repeat attempt to lock once
>>>>>SET REPROCESS TO 1
>>>>>pnLocRecord=0
>>>>>pnactivecount=0
>>>>>*-- pnMaxUsers = 5
>>>>>FOR i = 1 TO pnMaxUsers
>>>>>    IF EOF()
>>>>>        APPEND BLANK
>>>>>    ENDIF
>>>>>    IF RLOCK()
>>>>>       *--save locked record
>>>>>       pnLocRecord=RECNO()
>>>>>       EXIT
>>>>>   ELSE
>>>>>       pnactivecount=pnactivecount+1
>>>>>   ENDIF
>>>>>   SKIP
>>>>>NEXT
>>>>>SET REPROCESS TO (lnReprocess)
>>>>>
>>>>>Today I have a user reporting an issue when the process hangs.
>>>>>It only involves two particular machines. If one of the machine is already logged in into the system the other one will hang on the RLOCK() statement. Both machines are running Vista OS.
>>>>>Any one has any idea is to what can be the problem here?
>>>>>
>>>>>Thank you
>>>>>Yelena
Thanks,

Stacy



Black Mountain Software, Inc.
Previous
Reply
Map
View

Click here to load this message in the networking platform