Just a quick question about a comment before the lock method of one of my files. It say something to the effect of "no timeout is defined in this method" Does this mean the programmer is not to place a timeout mechanism in this method or that it is simply not there? ( I was possibly going to use something along these lines, but am not sure exactly how I will implement it, subclassing etc.) Im assuming its more along the lines of informing the programmer that it has not been created, but it seems the comment is slightly silly considering there is nothing in it . Just want to be sure Thanks much
Adam Roberts - SCJP2, SCJD<br />insert witty something here
I suspect the intent is to tell you that lock() will wait forever - unless you throw an exception, which you might want to do if someone has called lock(-1) with the intent of shutting down the database. I've heard (read) other comments on the idea of having an existing lock timeout to prevent a dead client from stopping others from accessing a record, but that's for existing locks, not a lock request. Hope this helps.
SCJP, SCJD, SCEA 5 "Any sufficiently analyzed magic is indistinguishable from science!" Agatha Heterodyne (Girl Genius)
Joined: Mar 18, 2002
Ahh ok My (very) general idea was to handle all the locking/unlocking through an intermediate class. This would be able to queue requests if the record was locked and would recieve a flag if the database was being shut down(lock(-1)). This make any sense?
Yes it does. It's called the LockManager. I wish I had had that in my submission, but alas I didn't. Mark p.s. OK here is what I originally wanted to write in response to this question. Yes This makes sense, because this is always this, unless it is that, then that does not make sense. I mean come on now have you ever heard of a correct sentence that had the same word repeated 4 times and still be correct. like in "That that that that boy wrote was good." Now that does not make sense, but this does. [ March 20, 2002: Message edited by: Mark Spritzler ]