Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Question about RLOCK(), SET REPROCESS TO...
Message
De
30/10/2001 10:25:25
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
30/10/2001 09:50:34
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00575019
Message ID:
00575055
Vues:
26
>After years, I find that I may not understand record locking as well as I thought!
>
>Let's say I have a SET REPROCESS TO 10 SECONDS
>
>And then I try to do an RLOCK() on a record that a user wants to edit.
>
>Let's say the RLOCK() fails after 10 seconds...control goes to my error handler.
>
>In the error handler, I trap error 108 (record is in use)...the 'problem' is that in the error handler, I want to be able to present the user with a messagebox and ask them if they want to retry (so they can go find out who has the record locked, then respond to the message). However, it appears that RETRY doesn't try for another 10 seconds to lock. Is that correct?
>
>TIA,
>Kevin

Kevin,
You get error after rlock(). How about another approach :
declare Sleep in Win32API integer
set reprocess to 1 && Try once only
start=datetime()
do while !rlock()
 if datetime()-start > 10 && 10 secs passed and not locked
   if messagebox('Continue to wait ?',YESNO)=NO
      exit
   else
      start=datetime() && reset timing
   endif
 endif
 Sleep(10) && A short delay to prevent deadlock
enddo
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform