Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Deleted field in .db

 
fei lin
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Can i treat deleted field in a record as a field? that way i read all records, even including deleted field, later in business if they decide to undelete him, it will be easy.
 
John Mattman
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The way i understood from my instructions is

When the user deletes a record, the program has to flag the first byte of that record with a value 0xff(255 i believe) and not physically delete it.

Next the program has to reuse the space of that record when you insert a new record. And of course you have to un flag that record.

Am i right/Wrong guys?

------------------

John
SCJP 5.0
[ March 19, 2008: Message edited by: John Mattman ]
 
Herman Schelti
Ranch Hand
Posts: 387
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi John,

Next the program has to reuse the space of that record when you insert a new record


Do you really mean "has to", or just "may"?

@Lin: if your specs do not mention "undeleting", I would not think about it.

Herman
 
John Mattman
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Herman,
Based on the comments of my delete method, I assumed that we need to reuse the space.Here are the comments that were in my interface provided by Sun.

// Deletes a record, making the record number and associated disk
// storage available for reuse.
public void delete(int recNo) throws RecordNotFoundException;

John
---------------
SCJP 5.0
 
Markus Homanner
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I asked myself the same questions shall I reuse the deleted record or not.
I decided against it because there are only view byte which will be
not used and a risk of a disk overflow is just very small.
Make sure you mention this in your choices.txt

Enjoy
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Markus",
Please check your private messages regarding an important administrative matter.
-Ben
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic