Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Recycle deleted records
Message
From
25/11/1997 11:29:04
 
 
To
25/11/1997 10:59:59
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00062037
Message ID:
00062175
Views:
27
>>>>>>In a multiuser environment, it is difficult to use PACK to remove a deleted record. To work around this problem, we can recycle the deleted records. In that case, we do not need to physically remove those deleted records. But in VFP if the table has primary index the deleted records will have a problem with the "uniqueness". I wonder whether there is a simple way to work around it.
>>>>>
>>>>>Sure. Change the key when you delete a record. Depending on how you generate unique keys, you can set a rule to have unique "real" keys and unique "deleted" keys.
>>>>>
>>>>>Vlad
>>>>
>>>>Or, when you reclaim a deleted record you can change the key id to the next available generated id.
>>>
>>>Thank you for your response. I have a further question here. When you try to recycle a deleted record, you need to locate deleted(). Will it be difficult when the table is huge?
>>
>>Not if you have an index on deleted() -- "index on deleted() tag delt"
>>
>>When you SET ORDER TO DELT, all deleted records will be listed last. So issue a SEEK DELETED() command, if FOUND() or !EOF(), you have found a deleted record assuming you have SET DELETED OFF.
>
>Mark...
> Once you find the deleted record, I assume the next step is to immeadiately RECALL the record. What are the chances that 2 users would RECALL the same record at the same time? (Assume a very active application!)

I think RLOCK() mechanism should be used here.
BTW, I've made the test and sent you results.
Edward Pikman
Independent Consultant
Previous
Reply
Map
View

Click here to load this message in the networking platform