Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
RLock()
Message
De
14/12/2004 14:00:51
 
 
À
14/12/2004 13:54:47
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
00969057
Message ID:
00969221
Vues:
7
>>>>>>Hi All
>>>>>>
>>>>>>I have a weird thing going on with RLOCK(). I have an app which starts at record 1 of a file and attempts to lock it using RLOCK(). If it returns .T. I do something with the record. All is fine.
>>>>>>
>>>>>>If I run another instance of the same app it also starts at the first record and attempts RLOCK(). It returns .F. because the first instance above has a lock on record 1 and so it moves on to record 2.
>>>>>>
>>>>>>This all works fine.
>>>>>>
>>>>>>However I do *not* have a SET REPROCESS command anywhere in my app and no REPROCESS setting in the config.fpw. The help says the second app should go into an continous wait state whilst attempting to lock record 1 because the default value for SET REPROCESS is 0. But this does not happen! The second instance of the app attempts the RLOCK(), it returns .F., and it continues to the second record.
>>>>>>
>>>>>>Why?
>>>>>>
>>>>>>I cannot make this same behaviour happen if I create a simple exe project to emulate the above. The simple exe test goes into a "wait or press Esc situation" as expected by the help documentation. I assume therefore that it is something unique to the main application but what could be the reason?
>>>>>
>>>>>try with -1 or -2.
>>>>
>>>>
>>>>Hi Fabio, Cetin, Gregory. I do not have a REPROCESS command anywhere in my app and yet I do not get a "Waiting for lock...Esc to cancel" message on an RLOCK on a record which is locked in the first app instance. It just returns .F. but should actually create the wait message. It behaves as if I had REPROCESS set to 1 ie. one attempt. But the docs say the default value is 0.
>>>
>>>hi Jos,
>>>
>>>Q1: is this in the IDE ?
>>>Q2: is it in the default datasession ?
>>>
>>>If both are true, would you look in Tools/Options/Date and see whet the settin is there ?
>>
>>No this is in a compiled exe which is loaded twice on a WinXP machine. Default datasession but working on a stand alone table DBF in this case.
>
>hi Jos,
>
>I surrender, out of ideas, ... But like Cetin said, there _has_to_ be a reason
>
>
>And you should initialize each datasession, including the default, with the settings you want. Reprocess, Ansi, Near, and the like. At least that is what I do

Thanks Gregory. Tomorrow I will write a full debug routine around it to try to understand it better but it is wierd. Thanks.
In the End, we will remember not the words of our enemies, but the silence of our friends - Martin Luther King, Jr.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform