Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
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

a record has been deleted,then unlock throws exception ..trouble!!!

 
Strong Z.Q. Jiang
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if a client wants to delete a record,it maybe call such methods in following order:
long cookie = lock(recNo);
delete(recNo,cookie);
unlock(recNo,cookie);

the trouble is:
if the record was deleted successfully then the unlock methods must throws RecordNotFoundException,I think it is unreasonable,how do you think?
 
B Chen
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does the throws specification in your unlock() method allow for RecordNotFound to be thrown? If not, then the only thing you can do is nothing.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic