I met a new problem. I create a thread which will repeatly run in the server to check if there is overtime locks on server. If there are such locks, this thread will release the lock and notifyAll().
BUT, In this scene, Client A locked record 1 but didn't unlock it and A crashed. Client B tried to lock record 1 but found the record had already locked by other so thread of Client B was wait(). AND NOW, the thread I mentioned before found there is a overtime lock(of record 1) and release the lock. BUT when this thread notifyAll(), it can not call the Thread of Client B from wait to run.
I have tried many way but found only notifyAll() from Remote(through RMI) can let the wait thread(from remote too) from wait to run. Thread on server can not notify the threads called by Client from remote.
Can somebody supplied a solution to resolve the problem of the perivous scene.
Thanks in advance!