File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

URLyBird 1.1.3 - should delete unlock a record automatically ?

 
Wei-ju Wu
Ranch Hand
Posts: 147
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 :-)
 
Ed Villamizar
Ranch Hand
Posts: 47
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Wei-ju Wu
Ranch Hand
Posts: 147
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 147
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ed,

the more I think about your suggestion, the more I like it. It is also closer to the spec.

Thanks

Wei-ju
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic