Thanks Mark for ur immediate reply.
Mark wrote:
The client which has the lock on 12 will only unlock 12. and then the second client that was trying to book 12 can now get the lock for 12.
as you have a wait() in your lock, do you also have a notify() in you unlock?
Ramesh wrote:
I do have a notify() in my unlock()
Mark what u said above will happen when two clients try to book a ticket for recordNo 12 and one followed by another.
Mark i make a client to wait only if there are
two request for the same record. i.e in my lock() method the wait() is called only for the recordNo which is already being processed in the same block say modify are in side unlock(ie already some client is trying to book ticket for the same record). Then wait() method will be called for the second client if the recno is same as the first. Else wait wont be called. I need ur comments.
Mark Please give me some test procedures to make sure that locking and unlocking works fine.
thanks & regards,
rameshkumar