user manual

212 BES Developers Guide
Handling of EJB exceptions
The client can also throw its own checked exception or re-throw the original
exception. By throwing an exception, the client lets other programs further up
the transaction chain decide whether or not to abort the transaction. However,
in general it is preferable for the code or program closest to the occurrence of
the problem to make the decision about saving the transaction.
Lastly, the client can continue with the transaction. The client can evaluate the
exception message and decide if invoking the method again with different
parameters is likely to succeed. However, you need to keep in mind that
retrying a transaction is potentially dangerous. You have no knowledge of nor
guarantee that the enterprise bean properly cleaned up its state.
Clients that are calling stateless session beans, on the other hand, can retry
the transaction with more confidence if they can determine the problem from
the thrown exception. Because the called bean is stateless, the client does not
have the problem of not knowing the state in which the bean left the
transaction.