Hi... I am too sorry for asking another question on this issue, but it's killing me, everytime I finish my Data class something comes up. I am very confused about the exceptions thrown from the locking and Crude methods. Which of the following is right:
I know that both code fragments may look similar, but if you dig deeper, you will see that the second lock() method will only grant locks to records that are valid, since it ensures the validity of the record after waiting. Hence, the delete, update and unlock methods will never throw RecordNotFoundException, since it'all been taken care of in the lock() method "is that right?". Meanwhile, the first lock() method may grant a cookie that points to a record that became invalid after waiting on it, in this case other methods will be capable of throwing RecordNotFoundException when the same cookie is used. My point is, why would the lock() method return a cookie to a record that became invalid as a result of waiting? Finally, which is a right : 1. lock: check if record is valid---->wait if necessary---->return cookie 2. lock: wait if necessary---->check if record is valid---->return cookie
I am too sorry for propagating this issue again, but I would appreciated if you can help.
Joined: Jun 10, 2005
Hi... So stupid of me, I know now when the crud methods can throw RecordNotFoundException: 1. lock 5 2. delete 5 3 try to delete 5 "RecordNotFoundException"