code: public static <T> T atomic(Supplier<T> supplier) {
          T result = null;
          try (Connection connection = sql2o.beginTransaction()) {
              connectionThreadLocal.set(connection);
              result = supplier.get();
              connection.commit();
          } catch (Exception e) {
              log.error("Transaction rollback", e);
          } finally {
              connectionThreadLocal.remove();
              return result;
          }
      }
docs: 原子提交
  
  @param supplier
  @param <T>