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

Physically delete the record

 
Ramesh Tiwari
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I downloaded URLyBird 1.3.3 two days ago.Currently, I am going through the documentation.
Documentation says we have to set a flag for deleted records marking them as deleted.But, the delete() in DBMain interface says "Deletes a record, making the record number and associated disk storage available for reuse. "
I am confused, do I need to physically delete the record from the file or just mark it as deleted.
Please explain.
Thanks
 
Mike Southgate
Ranch Hand
Posts: 183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
just mark it as deleted. However, the requirement does imply that your createRecord method should reclaim the space used by logically deleted records
ms
 
Ramesh Tiwari
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Mike, I got it.
 
Jim Yingst
Wanderer
Sheriff
Posts: 18671
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
However, the requirement does imply that your createRecord method should reclaim the space used by logically deleted records
Really? For Contractors, the instructions say you can do that, but they make clear it's not required. I guess this is a difference in assignments.
 
Bill Robertson
Ranch Hand
Posts: 234
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why would you mark it as deleted? If you just
mark it as deleted then when the user quits the
application you must update the DB. Why not update
the DB immediatley?
 
Jim Yingst
Wanderer
Sheriff
Posts: 18671
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To delete a record, you update the DB file so that the delete flag for that record indicates it's deleted. On my assignment this means I change the very first byte of the record from 0x00 to 0x01 - that's it. (Other assignments may use different values, and manybe two bytes instead of one, but the idea is the same as far as I know.) No other change is necessary; the record is considered "deleted" even though the remaining bytes are still there. If the record is requested in the future, the application checks the delete flag and throws RecordNotFoundException if the record is marked deleted. So "marking the record" means "deleting the record" as far as the DB file is concerned.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic