use of org.webpieces.http.exception.HttpException in project webpieces by deanhiller.
the class TransactionFilter method commitOrRollback.
private Action commitOrRollback(EntityManager em, Action action, Throwable t) throws HttpException {
EntityTransaction tx = em.getTransaction();
if (t != null) {
log.info("Transaction being rolled back");
rollbackCloseSuppress(t, em, tx);
if (t instanceof HttpException)
// the platform needs the original HttpException to translate to an http code
throw (HttpException) t;
else
throw SneakyThrow.sneak(t);
}
log.info("Transaction being committed");
commit(tx, em);
return action;
}
Aggregations