Dynamic Updating Problem
Posted in 1993
Topics: General Discussion
Problem : updating of dynamic data. ------- User-A selects (Account-balance) with the intention of updating it later. Following that, User-B selects with the same intention. So, if User-A updates the (Account-balance), User-B's update would produce an incorrect final Account-balance. Current Solution : using a flag ---------------- We have an (in_use_ind) field that a user sets when the record is being used. Another user accessing the same record will see that it is locked and will not use it. Current Problem with that Solution ---------------------------------- 1. The second user will be locked-out indefinitely. 2. A power failure will require a manual reset of the (in_use_ind). Looking For : ----------- A solution which will allow many users to use the record and update it, or give a warning if update is not possible because record had been changed by another user. I am thinking of using semaphores to keep track. Has anyone such a semaphore routine ? or any better suggestions ? Thanks ! contact : ssleong@csasoft.csam.MY