• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Junilu Lacar
  • Martin Vashko
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Scott Selikoff
  • salvin francis
  • Piet Souris

URLyBird 1.1.3 - should delete unlock a record automatically ?

 
Ranch Hand
Posts: 147
  • 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 :-)
 
Ranch Hand
Posts: 47
  • 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
  • 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
  • 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
 
I'm THIS CLOSE to ruling the world! Right after reading this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!