going over my application leaves me with one open question: Whether deleting a record should automatically unlock the record. Since the record was locked prior to the delete operation, performing an unlock() on the DB interface after deletion would raise a RecordNotFoundException.
I cache my deleted records, so leaving them in locked state would lead to problems when reclaiming and updating them at a later time.
These two facts seem to contradict each other, so I tend to favor unlocking the deleted record when making it unavailable.
Any suggestions or thoughts concerning this topic are highly appreciated :-)
"The UrlyBird catches the certificate. And he's gonna FlyByNight"<br /> <br />SCJP 1.2/5.0, SCJD, SCBCD, SCWCD, SCEA
An alternative is to erase the record from the Hashmap (or whatever structure you are using to keep track of locks) in the unlock method and throw the RecordNotFound exception anyway. (After confirming that the cookie or client is the right one of course). [ May 02, 2005: Message edited by: Ed Villamizar ]
Yes, seems like a possible way, the outcome of a lock-delete-unlock sequence would be pretty much the same (except for the case where the unlock is done with a wrong cookie)... Hm, seems that its not as big a problem as I thought ?
Joined: Feb 16, 2005
the more I think about your suggestion, the more I like it. It is also closer to the spec.
subject: URLyBird 1.1.3 - should delete unlock a record automatically ?