Originally posted by Ramy Atef:
what is the cookie while doing the locking of records issue. Is it right that the locking will be needed only during the update and delete methods? I have used a collection for storing locked record number and wait() and notifyAll() to do the lock() and unlock(). any comments that would help
Well the cookie that is provided with your lock method is generated by the lock method, this value is then used to track the thread that obtained the recNo! You would have to generate this value! This value is the one then used when you want to for example use the delete() method! The cookie is then checked for, this is to ensure that it's the thread that locked the record(The thread was given a cookie), is the same thread that wants to delete the record(the cookie value is cross-checked to ensure that it was the thread that locked the Record)! I hope my explanation helped abit! Have a nice day!