Returning a new client connection object which can also be used as the client ID can be achieved by using a factory
pattern.
This is the way I did it.
I had a RMI Connection factory object which is registered as a service. Each client trying to access the database uses a local connection factory which contacts the RMI connection factory to return a remote connection object. Every connection object (local or remote) implements a DataClient interface which holds all public methods of Data.
The returned object is the client ID, because each object is unique. The LockManager can use it for locking/unlocking. I used the client ID as the key in the LockManagers HashMap.
Hope this helps.
jay
------
SCJP
SCJD