Do I really need to investigate upon transaction management? Like between Locking & Unlocking, am I supposed to check if client is alive or not ? So does this kind of checking is expected in the assignment? Or its just optional part? waiting anxiously, from, vikram.
You can go approach the project with client tracking. I've been at this part myself for the past little bit. From what I've gathered though, that is above and beyond the scope of the project. If you are using RMI this gets a little more difficult. An RMI server can't query a client. In order to take an approach with client ids and verifying their existence you would have to create the clients are rmi servers themselves. If you are using serialized sockets I belive tracking clients is not a problem. There's lots of discussion on the forum on this topic. The way I took care of stale record locks was to when storing a record id as being locked, also store it in another hashmap along with the current time. Then on the server I created a low priority thread that awakens every 5 min, checks the lock times of all locked records and if any have been locked for 5 mins or more remove it. The question of how often to check for stale locks is an issue. 5 mins should be plenty, but is it too much? Hope this is of some help. Dave
Or you can use Unreferenced interface, to track dead clients. But my understanding - you could say you do not care about that - it is not a part of assignment. Just document, that you do that and why (for example, you can't have appropriate command line arguments - I heard this one somewhere)