Discussion Locked

Distinguishing between several client se

0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I have an RMI server to which several client sessions (running on one PC client) connect. To perform the record locking on the server I would like to obtain a unique handle to the client. Is there a way to do this? (getClientHost() returns the IPaddress but does not distinguish between the running instances when they run on one PC).
The program uses an object that has collections with lock and unlock possibilities.
Example :
- lock("MASTER", 12) will lock the 12th master object
- unlock("MASTER", 12) will unlock the 12th master object
- unlock("ALL") will unlock all objects locked by that client (should be JVM)
The program has been running well for some time while no two concurrent connections existed from the same client (using the IP address obtained by getClientHost()). The situation changed and now several clients are running on the same machine. I would prefer not to change the interface definitions or the client program.

5 replies

by petroff

Without having to modify the client or the interface this task is getting harder.
The clean solution is to have a session object, and store in it an unic session id.
This session object could be created after successfull logon for example.

by james_randy

The first answer looks good to me. If that doesn't work, try something else. Hope this helps.

This discussion is closed to new replies.