Java Reference
In-Depth Information
kind of exception; for example, if the booked seat is already engaged. Recoverable excep-
tions are called Application Exceptions.
There is also a possibility to mark a runtime exception (which would normally be a Sys-
tem Exception) as a recoverable exception, using the
@ApplicationException
an-
notation. You may even decide if the current transaction should be rolled back (which is
the default behavior for system exceptions) using
@ApplicationException
(with
rollback
true
) on an exception class or the
EJBContext.setRollbackOnly
state-
ment inside a business method. The decision to roll back a transaction is up to the deve-
loper, and in most cases, it depends on the business scenario.