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

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

 
Tony Bouer
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • 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
 
Jason Moors
Ranch Hand
Posts: 188
  • Mark post as helpful
  • send pies
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic