code: public static void rollback()
     {
        try {
           if (userTransaction.getStatus() != Status.STATUS_NO_TRANSACTION) {
              userTransaction.rollback();
           }
           else {
              LOGGER.warn("Request to rollback transaction when none was in started.");
           }
        }
        catch (Exception e) {
           LOGGER.warn("Transaction rollback failed.", e);
        }
     }
docs: Rollback the current transaction.