Win a copy of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 this week in the Java in General forum!
  • 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
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

lock/unlock

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
For the Java Development assignment, I am required to write some code for the lock and unlock method but I am baffled on how to do that. The basic problem is keeping check of which records are locked.
However, I have thought of an idea. Is it possible to have a file containing information on which records are currently locked? This file will be updated continually in that when a record is not used anymore it is removed from the file and when a record is used it is stored in file so the operation will involved lot of writing/deletion.
Is that a good approach?
 
Bartender
Posts: 1872
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Tim,

The basic problem is keeping check of which records are locked.


Yes, but also by whom they are locked.

Is it possible to have a file containing information on which records are currently locked?


Why in a file ? Locking is not a persistent information you need to keep between to starts of the application, is it ?
Cheers,
Phil.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic