Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Locking records
Message
De
06/02/2007 14:18:12
 
 
À
06/02/2007 14:06:09
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Versions des environnements
Visual FoxPro:
VFP 7
Divers
Thread ID:
01192613
Message ID:
01192945
Vues:
18
Rlock() locks current record only. However, the whole idea seems to be unnecessary. Your system may check table size and if it really approaches 2GB, commands all users out and pack/archive records.

>Something in the back of my brain is telling me that if I RLOCK() a record it will actually lock several records (all the records on that disk sector????), not all of which would be deleted. Is that correct or am I dreaming again? If so, is there any workaround or do I just have to accept the exposure (even though very short) while the record is locked during the update?
>
>The table(s) involved will have several million records. Would that have any impact on the algorithm (other than I need an Index Tag on DELETED())?
>
>Thanks a bunch for your help.
>
>>Hi Rich,
>>
>>Here's relevant piece of code from our Recycle routine
>>
>>...
>>SET DELETED OFF
>>SET ORDER TO
>>llGotOne = .F.
>>SCAN FOR DELETED()
>>  IF RLOCK()
>>	llGotOne = .T.
>>	* Blank out all the fields and get out of the loop
>>	BLANK
>>	RECALL
>>	EXIT
>>  ENDIF	
>>ENDSCAN
>>...
>>* Restore SET DELETED here
>>* Restore SET ORDER here
>>...
>>
>>
>>>We have a situation where the table size is approaching the 2GB limit. There is a process in place to extract a set of records, put them in an archive table, delete them, and then pack the table.
>>>
>>>Obviously, this requires a maintenance window to grab exclusive access to the table. This isn't always easy to get.
>>>
>>>My suggestion (based on several similar one's I've seen here) is to do essentially the same archive process but not pack the table. Whenever a new record needs to be insertted, the system will search for a deleted() record. If it finds one it BLANKS it and then updates the data. Otherwise it will follow the same Insert routine it now uses.
>>>
>>>The tables are NOT part of a database container and I'm pretty sure that no buffering is done. I'm also pretty sure that any solution which requires adding buffering would be rejected. In a multi-user environment (a couple of dozen simultaneous users) I'm wondering what the best technique is to avoid a situation where two users try to grab the same deleted record.
>>>
>>>All responses appreciated............Rich
Edward Pikman
Independent Consultant
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform