Hi,all.
My assignment is URLyBird 1.1.1, it's an early version of new ones.I got it last April, I put it off about half a year and want to finish it now, i've read lots of threads on many topics, they're really helpful, thank you all.
Here are some questions that still confused me, thanks any help or comments.
1. about lock-delete-unlock,how to avoid RecordNotFoundException in unlock method.
I've read this thread:
https://coderanch.com/t/184241/java-developer-SCJD/certification/NX-URLyBird-lock-delete-unlock Vlad suggested to do unlock in delete course, I'm not quite agree with that,I think "each method should do his own job",it is not proper for delete() to unlock a record, and even we can do this, how can a delete() throw a SecurityException(unlock check it)?
2. about locking, I now use a HashMap(Integer(recNo),Long(lockCookie)) to store locked records, but after read some articles on this topic, I found it can do nothing when a client crash occurs. But I don't know how to use a weakHashMap, because both recNo and lockCookie have to be stored.
3. In my implementation, both stand alone mode and server mode are involved in locking course, is this permitted? Or the alone mode need to by pass the entire locking course?
Thx for any reply