Two Laptop Bag
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


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’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: a record has been deleted,then unlock throws exception ..trouble!!!
 
It's not a secret anymore!