Wow - I am starting to see why throwing a RNFE is so contentious
@Ixus I agree that the behaviour you suggest will occur; however, I do not think this a normal flow. Once the record is deleted, then in my view it no longer exists and therefore can no longer be unlocked. In order to be able to call
unlock() on a deleted record the record would have to become some kind of zombie.
@Roel I accept that it is possible to write a client that can still function correctly even without
unlock() throwing, but I would not consider this good practice. For example imagine a client with a bug calls
unlock() for record number 1000 and cookie 0 and record 1000 does not exist and has never existed. What should the behaviour of
unlock be
pretend to unlock the record, but do nothingthrow SecurityException even though this is inconsistent with update()throw RNFE
I know there are many different versions of URLyBird out there, but my instructions state:
"Any methods that throw RecordNotFoundException should do so if a specified record does not exist or is marked as deleted in the database file."
To me it is pretty clear that a RNFE exception should be thrown by
unlock.
Roel De Nijs wrote: I passed with a perfect score
Congratulations!
Would love to see your choices.txt though, but alas that can never be...