Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Multiuser with free table
Message
From
19/02/2003 12:11:02
 
 
To
19/02/2003 10:01:40
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00754912
Message ID:
00755015
Views:
11
In addition to what Bob recommended, you could try a lock loop instead of a single attempt:
SET REPROCESS TO 0 && indefinite, I will tell it when to stop manually
lntimes=0
DO WHILE !LOCK() .and. lntime<100000
    ?LOCK()
ENDDO
SET REPROCESS TO 1
IF !RLOCK()
   WAIT WINDOW "could not lock record"
   *Error locking record, backout or try again later...
ELSE
   WAIT WINDOW "Successful record lock"
   *Save changes
ENDIF
UNLOCK
SET REPROCESS TO 0
>Hi,
>I am using free table (buffering - 5) in my multiuser application. It is a simple customer data entry app.
>Also, I am using vfp wizard to generate the data entry form.
>
>I face problem of "RECORD IS USED BY ANOTHER USER" when the baseclass try to RLOCK(). It occured when 2 users try to add 2 different records at the same time. Once the 1st user add the record successfully, the 2nd user will get the error.
>However, if I try to debug it, browse the table and re-try the RLOCK() again then it will sucessfully. Any ideas?
>
>Why the "new" record could be locked while other user add another?
>
>Pls help!!
>
>Thank you
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Previous
Reply
Map
View

Click here to load this message in the networking platform