Hi guys: I'm wondering do I need to verify a record to see if it's a valid record number or an undeleted record in lock() method, before doing lock process.
because I already verified each record in read, update and delete method, since lock method is only used before updating a record, such as: lock(); update(); unlock()
since update() method will verify record too, so I think maybe there is no necessay to verify record in lock() method.
I don't think so, in lock() method, I used while loop to detect is the record locked or not. why I need other method to verify the record isn't looked.
Originally posted by Jeroen T Wenting: You at the very least need to verify that the record isn't locked already...
Hello Jeremy: did you read the book <SCJD Exam with J2SE 5 2nd edition>
Originally posted by Jeremy Botha: How are you using a while loop to do the detection? Are you sure you don't run the risk of deadlocking your application?
Hmm. I'm not sure I'd use the method you've posted; it's far easier in my opinion to make use of wait() and notify()/notifyAll(). Each to his or her own though, I guess.
Jeremy
McFinnigan? Never heard of him. Nobody here but us chickens...<br /> <br />SCJP for Java 1.4<br />SCJD for Java 5.0
Joel Salatin has signs on his property that say "Trespassers will be Impressed!" Impressive tiny ad:
a bit of art, as a gift, that will fit in a stocking