• 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

NX:Question about dealing with a record

 
Ranch Hand
Posts: 222
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Question 1 : in the instruction, above the method delete of DBMain interface, it says:" Deletes a record, making the record number and associated disk storage available for reuse." Does it mean I should do:
change the flag at the beginning of that record from 0x00 to 0xFF
(What about it's already 0xFF?)
Question 2 : there's a find(String [] criteria) method, does it make sense to a deleted record? What about others (e.g. read, update etc), should they just throw a RecordNotFoundException if the specific record is marked deleted?
Question 3 : Assume there're three record: A B and C, the number is 0, 1 and 2, if B was deleted, then should I skip B and directly use C as the number 1 record, so there 're A (B) C number: 0 (1) 1 ???
Sorry for trouble you.
 
Ranch Hand
Posts: 4982
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


Question 1 : in the instruction, above the method delete of DBMain interface, it says:" Deletes a record, making the record number and associated disk storage available for reuse." Does it mean I should do:
change the flag at the beginning of that record from 0x00 to 0xFF


yes.


(What about it's already 0xFF?)


The system should throw RecordNotFoundException


Question 2 : there's a find(String [] criteria) method, does it make sense to a deleted record? What about others (e.g. read, update etc), should they just throw a RecordNotFoundException if the specific record is marked deleted?


They just throw RecordNotFoundException


Question 3 : Assume there're three record: A B and C, the number is 0, 1 and 2, if B was deleted, then should I skip B and directly use C as the number 1 record, so there 're A (B) C number: 0 (1) 1 ???


I keep the original sequence. i.e.
0 A
[1 B] // Do not display
2 C
And in order to reduce the appearence of the layout, I decide NOT to display the record number.
Hope this help.
Nick.
 
HaoZhe Xu
Ranch Hand
Posts: 222
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I understand, thanks a lot.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic