mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

jvergara
28.42.2008 d88705ba2fe6264a6a8e8ef97b10e48a9635f4c8
Close the connection that is created for the task, once the task is over.  This is required when we are using the Tool classes in embedded mode.
1 files modified
16 ■■■■■ changed files
opends/src/server/org/opends/server/tools/tasks/TaskTool.java 16 ●●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/tools/tasks/TaskTool.java
@@ -394,8 +394,9 @@
        }
      }
      LDAPConnection conn = null;
      try {
        LDAPConnection conn = argParser.connect(out, err);
        conn = argParser.connect(out, err);
        TaskClient tc = new TaskClient(conn);
        TaskEntry taskEntry = tc.schedule(this);
        Message startTime = taskEntry.getScheduledStartTime();
@@ -474,6 +475,19 @@
        Message message = e.getMessageObject();
        if (err != null) err.println(wrapText(message, MAX_LINE_WIDTH));
        ret = 1;
      } finally
      {
        if (conn != null)
        {
          try
          {
            conn.close(null);
          }
          catch (Throwable t)
          {
            // Ignore.
          }
        }
      }
    } else {
      ret = processLocal(initializeServer, out, err);