• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to identify if client terminates in the middle...

 
Manoj Gundawar
Ranch Hand
Posts: 169
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
This issue might have been discussed earlier and this might be a redundent question. If it is, please provide the link of earlier discussion, if anybody knows it.
Question:
In case LOCK, UPDATE, UNLOCK are called on the Client side, and client closes the application (cntrl C) just after LOCK call was finished and UPDATE and UNLOCK were not called so far, how server will know about this, so that it can UNLOCK this record?
In my case: I am using single data instance and registaring records to be locked in a static vector, which is shared by all the clients. I need to remove record from this vector, when clint abruptly closes the application before UNLOCK was called. (UNLOCK is called from CLient and not the server)
Any clues?
Thanks,
Manoj
 
Philippe Maquet
Bartender
Posts: 1872
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Jmannu,
In case LOCK, UPDATE, UNLOCK are called on the Client side, and client closes the application (cntrl C) just after LOCK call was finished and UPDATE and UNLOCK were not called so far, how server will know about this, so that it can UNLOCK this record?

You could find this thread useful, especially the very first part of it. Jim, if you're reading me, I'am just teasing you (and Max).
Now if you perform a search on this forum with the keyword "WeakHashMap", you'll find a few other threads which may interest you. Another useful keyword in this context is "deadlock".
Best,
Phil.
 
Manoj Gundawar
Ranch Hand
Posts: 169
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Philippe,
Thanks a lot for the link. I am still trying to assimiliate the discussion posted there. Will certainly post if I get any new doubt out of that dicussion.
Thanks a lot again.
Manoj
 
Philippe Maquet
Bartender
Posts: 1872
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Manoj,
Thanks a lot for the link. I am still trying to assimiliate the discussion posted there. Will certainly post if I get any new doubt out of that dicussion.

You're welcome. Feel free to come back with any doubts you could have.
As I am supposed to still understand what I wrote myself, I hope I'll be able to clear them.
Best,
Phil.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic