Hi!
I failed in URLy Bird assignment due to the Locking mecanism approuch.
I have the following at my test result:
The maximum possible score is 400; the minimum to pass is 320. General Considerations (maximum = 100): 100 Documentation (maximum = 70): 70 O-O Design (maximum = 30): 30 GUI (maximum = 40): 38 Locking (maximum = 80): 0 Data store (maximum = 40): 40 Network server (maximum = 40): 40 Major point loss for record-locking mechanism, which is not according to spec. In the Data class, the lock() method is supposed to block when requested to lock a locked record. Your implementation returns immediately.
When trying to access a database locked record, my app returns directly
and it shows a message saying "Record locked ...". But looking at the
examiner comments, I would to block the request to lock the record unitl it becomes avaible. Am I right ? Should I use wait() and notify() in the lock method of the database class ?
Using it, I block the request, but the app window with is waiting for the lock release becomes blank. Is there any wait to avoid this behavior ?
Could anybody help me ?
Thanks in advance!
Michel.
[Andrew: changed code] [block to [quote] block]
[ January 07, 2005: Message edited by: Andrew Monkhouse ]