• Post Reply Bookmark Topic Watch Topic
  • New Topic

timeout for client

 
Aslam Chima
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
I am trying to implement the time out functionality for the locked records by a particular Client. Now I have gone throw the msgs posted on this list and what I have understand from here is to have a static synchronized map and store the recNo and the time at which the record was locked.
Now my question is here how is the timeout checked, have you guys/gals used a Timer to check the map after every min or so. I am a little confused here about the timeout. Do we even need to provide this functionality if not why every one is using a hashtable and not a vector for locking.
thanks
Aslam
 
Matthew Comer
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rather than a fixed timeout period, I implemented a trap that frees locks when a given connection ends. If you used RMI, take a look at the "Unreferenced" interface that RMI supports. If you have a connection object that relates directly to a client connection, then you can free locks whenever the unreferenced() method gets called on your object...
 
my overalls have superpowers - they repel people who think fashion is important. Tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!