• 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
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

How to call lock and unlock from client

 
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.
 
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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
    Bookmark Topic Watch Topic
  • New Topic