Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to call lock and unlock from client

 
Anurag Mishra
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am confused, how to call lock and unlock method from gui. If client calls the record with -1 argument passed the whole database will be locked than what will happen to that client whose record is already locked while booking the seat, also how to unlock the whole database by the client side.
 
Mike Birken
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What will happen to other clients who own locks or are requesting locks when you want to lock the entire DB is a good question. There are lots of options. When you want to lock the entire DB, you can wait until no records are locked before grabbing all the locks. Or, you can grab all the free locks and as additional locks become free you can grab those and eventually you should get them all. Or, you can steal all locks away from clients owning locks and notify them that their locks are no longer valid. Things to think about is avoiding deadlock and fare sharing of resources (both not really required for the assignment though). As for unlocking all, how about -1 in unlock?
- Mike
 
Anurag Mishra
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Mark,
Plz see my other question's and suggest me how i have to furthur continue with my assignment.I am very much confused how i can remove stale locks which other client's left unlocked.I think i have to use distributed garbage collection algorithm but i dont know how i works and how to write code for this alog. Plz if you have another suggestion, help me out.
Anurag Mishra
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic