public void run() {
    assert task != null;
    try {
      startTime = System.currentTimeMillis();
      ProgressHandle handle = ProgressHandleFactory.createHandle(title, this);
      handle.setDisplayName(titleMsg);
      handle.start();
      try {
        handle.switchToIndeterminate();
        dataView.setInfoStatusText(""); // NOI18N
        errorMsg = ""; // NOI18N
        dataView.disableButtons();

        conn = DBConnectionFactory.getInstance().getConnection(dataView.getDatabaseConnection());
        String msg = "";
        if (conn == null) {
          Throwable connEx = DBConnectionFactory.getInstance().getLastException();
          if (connEx != null) {
            msg = connEx.getMessage();
          } else {
            msg =
                NbBundle.getMessage(
                    SQLStatementExecutor.class,
                    "MSG_connection_failure",
                    dataView.getDatabaseConnection());
          }
          NotifyDescriptor nd = new NotifyDescriptor.Message(msg);
          DialogDisplayer.getDefault().notify(nd);
          return;
        }
        lastCommitState = setAutocommit(conn, false);
        execute(); // delegate
      } finally {
        handle.finish();
      }
    } catch (Exception e) {
      this.ex = e;
    } finally {
      if (ex != null) {
        errorMsg += ex.getMessage();
        error = true;
      }
      finished(); // delegate
      resetAutocommitState(conn, lastCommitState);
    }
  }