Originally posted by Vagner Freitas:
Hi All,
In HFE page 279 bullet 5 she says:
"All finders must declare both a RemoteException and a FinderException".
I wonder why multiple-entity finders must declare FinderException because do not throw an exception if no matching entities are found.
Tanks in advance.
Because a FinderException can be thrown also for reasons other than the fact that the underlying entities haven't been found.
From
EJB Specs 10.5.8.3:
From the client�s perspective, a FinderException (or a subclass of FinderException) indicates
that an application level error occurred during the find(...) operation. Typically, the transaction
has not been marked for rollback because of the FinderException.
The Container throws the FinderException (or subclass of FinderException) from the implementation
of a finder or select method to indicate an application-level error in the finder or select
method. The Container should not, typically, mark the transaction for rollback before throwing the
FinderException.
Marco Tedone<br />SCJP1.4,SCJP5,SCBCD,SCWCD