fredintaiwan
14th January 2009, 12:44
Hello Everyone,

Have a query.

What is the difference between Lookup(Restricted) and Restricted(with counter) in the Delete Mode in session Table Definition fields ttadv4122s000?

In my opinion, in Restricted(with counter), a parent record cannot be deleted if any child refers to this parent. A reference counter is checked, which indicates how many child records refer to the parent. With each database action, this counter is checked and updated as necessary. The counter is checked whenever a delete action is initiated on the parent table, and permits the deletion only if the reference counter is equal to zero. Every time a child is added to a parent, the parent's refcntd is incremented. when a child is removed, it is decremented.. When the value is zero, you can delete the parent

In my opinion, in LOOKUP(RESTRICTED), the deletion of the parent is restricted if any child refers to the parent. Upon deletion of the parent, all child tables will be checked. This option is similar to Restricted(with counter), but does not use counters. Lookup (restricted) means that the driver will actually issue a query against the DB on that table to see if the children are present

Also what is the meaning Nullifies option in the Delete Mode.

However i do not understand the difference between the above Restricted(with counter) and LOOKUP(RESTRICTED). Would prefer if you could give me examples for the same explaining the exact application of the same.

ARijke
14th January 2009, 14:10
I think your explanation is correct.

The restricted with counter is not preferred for data which is used frequently. Each time the referenced table must be updated. This can cause locking on the referenced table. Creating 2 orders both having the same item gives 2 updates on the same item. During the deletion it is 'cheaper' only the counter needs to be checked.

The lookup restricted has no extra update. During the delete all tables must be checked whether the item is in use. So the 'costs' are taken during the delete. But that is a one time action.

Nullifies would give as a result of the delete of an item, empty item codes on a purchase order. Which is often not allowed from a functional perspective. So this will he hardly used.

Regards, Adriaan