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

abobrov
15.37.2009 8c2de84b13737083305368f82cdaec45c0164836
opends/src/server/org/opends/server/backends/ndb/EntryContainer.java
@@ -313,6 +313,7 @@
    AbstractTransaction txn = new AbstractTransaction(rootContainer);
    try {
      // Fetch the base entry.
      long baseEntryID = 0;
      Entry baseEntry = null;
      baseEntry = dn2id.get(txn, baseDN, NdbOperation.LockMode.LM_Read);
@@ -327,6 +328,8 @@
          message, matchedDN, null);
      }
      baseEntryID = (Long) baseEntry.getAttachment();
      if (!manageDsaIT) {
        checkTargetForReferral(baseEntry, searchScope);
      }
@@ -346,17 +349,21 @@
      indexFilter.scan();
      try {
        long eid = indexFilter.getNext();
        while (eid != 0) {
        long eid = 0;
        while ((eid = indexFilter.getNext()) != 0) {
          if (lookthroughLimit > 0 && lookthroughCount > lookthroughLimit) {
            //Lookthrough limit exceeded
            // Lookthrough limit exceeded
            searchOperation.setResultCode(ResultCode.ADMIN_LIMIT_EXCEEDED);
            searchOperation.appendErrorMessage(
              NOTE_NDB_LOOKTHROUGH_LIMIT_EXCEEDED.get(lookthroughLimit));
            return;
          }
          // Skip over base entry.
          if (eid == baseEntryID) {
            continue;
          }
          // Fetch the candidate entry from the database.
          Entry entry = null;
          AbstractTransaction subTxn = new AbstractTransaction(rootContainer);
@@ -430,9 +437,6 @@
          }
          searchOperation.checkIfCanceled(false);
          // Move to the next record.
          eid = indexFilter.getNext();
        }
      } finally {
        indexFilter.close();
@@ -497,7 +501,7 @@
        while (result != null) {
          if (lookthroughLimit > 0 && lookthroughCount > lookthroughLimit) {
            //Lookthrough limit exceeded
            // Lookthrough limit exceeded
            searchOperation.setResultCode(ResultCode.ADMIN_LIMIT_EXCEEDED);
            searchOperation.appendErrorMessage(
              NOTE_NDB_LOOKTHROUGH_LIMIT_EXCEEDED.get(lookthroughLimit));