Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Unlocking the entire database?

 
John Sinues
Ranch Hand
Posts: 52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When lock(-1) is called, we are suppose to lock the entire database. How do we unlock it? Can we assume unlock(-1) unlocks the entire database?
- John Sinues
 
Padmaja Prasad
Ranch Hand
Posts: 76
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Same way as lock(-1). You can loop through all records and call recursively unlock(record) for each record.
Padmaja
 
Mark Spritzler
ranger
Sheriff
Posts: 17276
6
IntelliJ IDE Mac Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Or not implement unlock(-1) and put in your design.txt that lock(-1) should only be used for the server to shutdown the server, and that unlocking the records then would be pointless.
Mark
 
John Sinues
Ranch Hand
Posts: 52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Mark, I like that approach.
- John
 
Abhinav Anand
Ranch Hand
Posts: 113
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Or not implement unlock(-1) and put in your design.txt that lock(-1) should only be used for the server to shutdown the server, and that unlocking the records then would be pointless.

What about the scenario when you have to add a record and you need to lock the whole database. Is it justified to assume that no records will be added at all in future.
 
Sai Prasad
Ranch Hand
Posts: 560
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Vishal,
Why do you have to lock the entire database to insert one record?
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic