}
}
private void endTransaction(boolean success, String requestURI) throws ServletException {
try {
TransactionStatus status = TransactionStatus.byCode(tx.getStatus());
if (success && status.isCommittable()) {
logger.debug("committing transaction for {}", requestURI);
tx.commit();
}
else if (status.isRollbackable()) {
logger.debug("rolling back {} transaction for {}", status.getAdjective(), requestURI);
tx.rollback();
}
else {
logger.warn("unable to either commit or roll back {} transaction for {}", status.getAdjective(), requestURI);
}
}
catch (Exception e) {
String message = "exception ending transaction for " + requestURI;
logger.warn(message, e);