Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Deleting a record while someone is using it?
Message
From
16/06/1998 11:55:21
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00108671
Message ID:
00108701
Views:
38
>>>Hi,
>>>
>>>How to deal with deleting a record while someone else is using it undirectly.
>>>
>>>Example:
>>>
>>>I want to delete suppliers that has no more link to any tables but someone is making a invoice (private datasession, pessimistic buffering) with some of them.
>>>
>>>I have two choice for now.
>>>
>>>1. When I save my transaction, I will check again if the supplier is there and before deleting the supplier I will check if there is a new transaction when I save.
>>>
>>>Pro: Not blocking anyone
>>>Con: More Validation at saving, annoying for the user if it happen's
>>>
>>>2. Open in exclusive the suppliers table and blocking everyone to work with the system for that time.
>>>
>>>Pro: Best for keeping the integrity
>>>Con: Blocking anyone, annoying for the user
>>>
>>>I use the suppliers tables but there may be tables that block more/less the system.
>>>
>>>Is there any other ways?
>>>
>>>Those the RI check for buffering? I don't think so.
>>>
>>>Can I check tables involve in buffering even if it's not official yet?
>>>
>>>Thank you in advance for your answers
>>>
>>>Steve
>>
>>You can RLOCK() supplier before deleting invoice. Also, you will RLOCK() supplier before deleting it in another form, so just one of users will go ahead.
>
>I was not trying to delete the invoice but ADD it (no link yet).

Sorry, I meant 'before adding invoice'. Also, RI trigger (Insert-Restrict) will provide this.

>Of course, but I have "utilisation code" table that the user can modify.
>
>In another table, I got 3 field wich contain the utilisations. So, when
>I edit/add, I would have to lock each field that has a table link to it.
>I'm searching for a method standard for the whole system.
>
>What would you do then?
>
I don't quite understand the purpose of 'utilisation code table'. Normally, RI triggers will always check Data integrity even without any locking, if you want to make the process more sophisticated, e.g. make sure that the supliier really exists when you add an invoice, then you can use RLOCK(). I wonder if pessimistic locking/ private DS is good scheme for this, but it's always question of personal preferences.
Edward Pikman
Independent Consultant
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform