• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

What is this cookie issue while using locking?

 
Ramy Atef
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Saheed Adepoju
Ranch Hand
Posts: 267
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic