URLyBird 1.1.3 - should delete unlock a record automatically ?
Wei-ju Wu
Ranch Hand
Joined: Feb 16, 2005
Posts: 147
posted
0
Hi,
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
Ed Villamizar
Ranch Hand
Joined: Sep 02, 2004
Posts: 47
posted
0
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 ?
Wei-ju Wu
Ranch Hand
Joined: Feb 16, 2005
Posts: 147
posted
0
Hi Ed,
the more I think about your suggestion, the more I like it. It is also closer to the spec.
Thanks
Wei-ju
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.
subject: URLyBird 1.1.3 - should delete unlock a record automatically ?