Hi guys,
I read a lot about the locking problem from previous topics, but i could not find the answer to my problem.
Below is the DBMain interface from my instructons:
Below is my solution foor lock/isLocked/unlock and delete methods. (In delete method, i have bypassed the unlock method because once the record is deleted, unlock method throws an exception.)
I'm aware that my solution is a little bit strange, but i could not think of another way because of 'RecordNotFoundException' thrown from each method. I could have written the code like this in order to fit in this locking contract. Do you have any idea that my code is acceptable or not?
Have you thought of a similar approach?
Ulas Onder
SCJP, SCWCD
[Andrew: removed islocked() and unlock() methods]
[ March 15, 2004: Message edited by: Andrew Monkhouse ]