Oracle Certified Master Java SE6 Developer(SCJD),
OCE JEE 6 JSP and Servlets Developer,
Java EE6 Java Server Faces Developer.
Originally posted by Liviu Carausu:
Hi all,
I have B&S application and a "clean" method signature for the "find" method that does not throw RecordNotFoundException.
The problem is as follows : while checking if the records are matching the given condition, it can be that a record is deleted and the RecordNotFoundException is thrown.
The solution that I have is to swallow the RecordNotFoundException and to ignore the record that was just deleted
Do you think that this is acceptable ? Does anybody have a better solution ?
Thank you very much in advance,
Liviu
SCJP 5<br />SCJD
Originally posted by mohamed sulibi:
hi Jim;
please don't return null , because the caller expect an array but you can return an empty array or list in bussiness class. so the caller can safty iterator on the return array or list.
regards.
SCJP 5<br />SCJD
In my opinion, the exception should be thrown in the case search result is empty and follow the interface contract. That's the only reason for the exception there.
The caller is going to have a catch clause for that anyways.
SCJP 5, SCJD 5, SCWCD 5, SCDJWS 1.4, SCBCD 5, SCEA 5
Consider Paul's rocket mass heater. |