I think NotifyAll() is required in lock() method. I have seen some discussions aound this topic. I thought of creating a separate
thread just to understand this more.
[I] Data.java[I]
IMO If you don't have notifyAll() method, then it is a database level locking implementation and not record level.
Anytime a client need to book,update or delete a reacord, the client needs to acquire a lock on a specific record. After a lock is acquired on a specific record, why the client need to hold the entire lockedRecords object until it finishes the book,update or delete and then unlocks. Another client interested on locking a different record can have a chance to do so, if you notofyAll() immediately after you have acquired a lock on a specific record.
Now question about whether another client can unlock a record originally locked by a client doesn't arise, if you have implemened the cookie correctly.
Sudhansu<br />SCJP, SCWCD, SCBCD, SCJD, SCEA, SCDJWS