• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

delete operation

 
K Madan
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
// Deletes a record, making the record number and associated disk
// storage available for reuse.

// Throws SecurityException if the record is locked with a cookie
// other than lockCookie.
public void deleteRecord(long recNo, long lockCookie)
throws RecordNotFoundException, SecurityException;

Data section.
Repeat to end of file: 1 byte "deleted" flag. 0 implies valid record, 1 implies deleted record

This text is from B&S assgnment can anyone please explain what does delete operation actually does :-
1. sets a (delete)byte to 1 in the file for the record
2. removes it from the file (as in the interface doc it says
associated disk storage available for reuse.

anyone knows this?
thanks
 
Hanna Habashy
Ranch Hand
Posts: 532
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
I means that the record should be marked as deleted, and in future add operation you can use the same space to enter the new record.
Basically, it says that when you add a new record, you should find a deleted record first then overwirte it.
 
K Madan
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Hanna
it makes sense now !
cheers
-Km
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic