aspose file tools*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes a record has been deleted,then unlock throws exception ..trouble!!! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "a record has been deleted,then unlock throws exception ..trouble!!!" Watch "a record has been deleted,then unlock throws exception ..trouble!!!" New topic
Author

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

Strong Z.Q. Jiang
Greenhorn

Joined: Dec 25, 2005
Posts: 3
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

Joined: Dec 27, 2005
Posts: 89
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.


SCJD<br />SCJP 1.4
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: a record has been deleted,then unlock throws exception ..trouble!!!