code: public static void commit()
     {
        try {
           if (!isDone()) {
              userTransaction.commit();
           }
           else {
              LOGGER.warn("commit() called with no current transaction.");
           }
        }
        catch (Exception e) {
           throw new RuntimeException("Transaction commit failed.", e);
        }
     }
docs: Commit the current transaction.