I am doing the final piece of the puzzle, the locking bit. I have been looking through some posts about the locking methodology, and i have come up with the following bit of code. What i dont understand is why do I need the isLocked method. When i am doing a booking i do the
do the booking
i could use the isLocked method in the lock method to test the while condition. I have read a post which suggest the islocked in not required but rmandantory because its in the interface.
I just want to confirm the isLocked method is fine and not required apart from implementing suns interface
Hi the isLock() method is required to implement cos it's part the interface. However, it's not necessary to use it. But it can be called inside your update/delete to ensure that record is locked before doing the actual update/delete.
I agree with K Tsang that this method must be implemented, but need not be used. Slightly off topic - Ken Schwarber presented a talk on Scrum at Google, and towards the end of it (if I remember correctly) he talks about one of the typical problems with Waterfall, namely that because it becomes so difficult to introduce a change in the project 6 months after it is started, people tend to put into the requirements documents every possible thing they can think of, even if it has little value. In that respect, the instructions from Sun are very typical - they often contain instructions that have little or no value. And some of these are included deliberately just so that the developer has to make a design decision.