Originally posted by Kevin Cao:
BJ-
As I understand, the only time finally statement would not be executed is if the System.exit()method terminates the program. So, data.unlock() will execute no matter what.
-Kevin
You are right, what I meant by a client dying is the network connection to the server goes away. In general, my point is what if unlock fails for some reason? For example, you have exposed the methods of Data to the client through some remote object. You have a client business class with a method such as bookFlight that calls lock read modify unlock against the remote object that exposes Data to the client. Suddenly, the client's network connection fails, and the call to unlock on the remote Data never makes it to the server. Now you have a record locked and the owner is gone.
[ February 21, 2003: Message edited by: BJ Grau ]