• 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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Physically delete the record

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 183
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you Mike, I got it.
 
Wanderer
Posts: 18671
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 234
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 18671
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic