• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Liutauras Vilda
Sheriffs:
  • Paul Clapham
  • Jeanne Boyarsky
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
Bartenders:
  • Jesse Duncan
  • Frits Walraven
  • Mikalai Zaikin

Local mode and locking.

 
Ranch Hand
Posts: 111
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am facing a very interesting problem and struggling to find an answer.
The problem starts form the fact that i am assuming that in local mode the GUI is being run on the server and so at one end the server is being used as a local database server and on the other hand it is being used as a remote database server.
Now the problem arises from the fact that when i start the remote server on the server machine and i start the gui on it too, these two are being run in two differnt virtual machines and thus how do you provide locking in such a scenario.
Any help in this scenario will be highly appreciated.
Gaurav Kalra
 
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I thought on this too - but it seems impossible to have a locking which can cater to both the local and the server clients - As server clients would use one object of the Data class and the local client would use another. There is no common meeting place for the two except in the Database file - ( just for trial - try marking the record which has to be locked - just as a deleted record is marked).
Then I re-read the instructions and found that Sun expects the user to be EITHER in local or networked mode. So I have used locking for networked mode only.
Pls. also shed light on how are you planning to inform the Client that his thread is waiting - if the record is locked.
 
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
according to the assignment instruction, in local mode, the databae and user interface should run in the same VM and no networking is performed, and no sockets(RMI implemented in sockets) should be created. So, excepting you put lock status in db.db file, the lock/unlock mechanism will be no use in local scenario.
 
pie. tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic