Originally posted by Gennady Shapiro:
even if you do have a server-based Connection (or Session) object per client, which I do, there is still no guarantee that this object's methods are called by the same thread. What do you mean by distnguishing clients by this object? [...] I am confused about that, maybe RMI does map thread to server objects after all.
No, RMI doesn't. There is no guarantee that it will always continue to work. There is certainly no guarantee it will work on another
Java implementation or version.
If you really have a Connection per client, then you can use those objects to identify client. You can associate a lock with a Connection object. If a lock(record) call comes through and there is an existing lock associated with the same Connection, you know you can ignore it. If Connection.close() is called, you can clean up all the locks associated with that connection. Etc. Etc. All using simple object equality (==).
- Peter