* @throws Exception when handling the exception.
*/
protected void handleContextContainerTransaction(final EasyBeansInvocationContext invocationContext,
final Exception e) throws Exception {
ApplicationException applicationException = getApplicationException(invocationContext, e);
// An application exception ?
if (applicationException != null) {
/*
* If the instance called setRollback-Only(), then rollback the
* transaction, and re-throw AppException.
*/
if (isMarkedRollbackOnly()) {
rollback();
throw e;
}
/*
* Mark the transaction for rollback if the application exception is
* specified as causing rollback, and then re-throw AppException.
* Otherwise, attempt to commit the transaction, and then re-throw
* AppException.
*/
if (applicationException.rollback()) {
// TODO: rollback or mark rollback ??
rollback();
} else {
commit();
}