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

Local mode and locking.

Ranch Hand
Posts: 111
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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.
So it takes a day for light to pass through this glass? So this was yesterday's tiny ad?
Devious Experiments for a Truly Passive Greenhouse!
    Bookmark Topic Watch Topic
  • New Topic