File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes URLyBird 1.1.3 - should delete unlock a record automatically ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "URLyBird 1.1.3 - should delete unlock a record automatically ?" Watch "URLyBird 1.1.3 - should delete unlock a record automatically ?" New topic
Author

URLyBird 1.1.3 - should delete unlock a record automatically ?

Wei-ju Wu
Ranch Hand

Joined: Feb 16, 2005
Posts: 147
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
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 ]

MBA, PMP<br />SCJP, SCJD<br />ITIL Foundations Certified.
Wei-ju Wu
Ranch Hand

Joined: Feb 16, 2005
Posts: 147
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
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://aspose.com/file-tools
 
subject: URLyBird 1.1.3 - should delete unlock a record automatically ?