• 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

Data class methods (read/create/update/delete)

 
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I need an opnion on that:
1. Inside my find method I call read method which give me an RecordNotFoundException (I just log this and still searching for the others) for deleted or non-existent records or the record itself so I can make the appropriated comparisons. Are somebody using this approach ?

2. I'm planning to create a readDeletedRecords method to return an array of recNo that are available for update / create. Should I lock the deleted record ?

Thanks,
Tony
 
Ranch Hand
Posts: 188
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Tony,

1) I don't think you should log the RecordNotFoundException in your find method as it's not really an error. I would recommend creating a private read method which doesn't throw a RecordNotFoundException, this method could then be used by the other public methods which would throw the RecordNotFoundException.

RecordNotFoundException

2) I'm not sure if there is any benefit in reading the whole file to return an array of recNo, why not just return the recNo of first available?

regards
Jason
 
"How many licks ..." - I think all of this dog's research starts with these words. Tasty tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic