private void safeRollback()

in jpa-support/src/main/java/org/apache/aries/jpa/support/impl/XAJpaTemplate.java [97:116]


    private void safeRollback(TransactionToken token, TransactionAttribute ta, Coordination coord, Throwable ex) {
        LOGGER.warn("Beginning rollback logic due to exception", ex);
        try {
            Transaction tran = token.getActiveTransaction();
            if (tran != null && shouldRollback(ex)) {
                LOGGER.info("Rolling back TX due to exception", ex);
                tran.setRollbackOnly();
            }
        } catch (Exception e) {
            // we do not throw the exception since there already is one, but we
            // need to log it
            LOGGER.warn("Exception during transaction rollback", e);
        }
        
        try {
            safeFinish(token, ta, coord);
        } catch (RollbackException e) {
            LOGGER.warn("RollbackException during safeFinish attempt for already running safeRollback", e);
        }
    }