code: public static void commitTransaction() {
          Connection connection = tl_conn.get();
          if (connection == null) {
              throw new RuntimeException("You do not start a Transaction so you can not commit a transaction!");
          }
          try {
              connection.commit();
              connection.close();
              tl_conn.remove();
              tl_sp.remove();
          } catch (SQLException e) {
              JDBCUtils.rollbackTransaction();
              throw new RuntimeException(e);
          }
      }
docs: 提交事务并关闭该事务，该事务连接是线程安全的。提交失败会回滚事务。