• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

lock/unlock

 
Tim Adam Cooper
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • 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?
 
Philippe Maquet
Bartender
Posts: 1872
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic