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

Jean-Noel Rouvignac
02.27.2013 b795e027216c93c7feca7f6e8faece6f8f51985a
opends/src/server/org/opends/server/replication/server/changelog/je/ReplicationDB.java
@@ -270,7 +270,8 @@
    catch (DatabaseException e)
    {
      MessageBuilder mb = new MessageBuilder();
      mb.append(NOTE_EXCEPTION_CLOSING_DATABASE.get(this.toString()));
      mb.append(NOTE_EXCEPTION_CLOSING_DATABASE.get(toString()));
      mb.append(" ");
      mb.append(stackTraceToSingleLineString(e));
      logError(mb.toMessage());
    }
@@ -589,26 +590,24 @@
        }
        localCursor = db.openCursor(txn, null);
        if (startCSN != null)
        if (startCSN != null
            && localCursor.getSearchKey(key, data, LockMode.DEFAULT) != SUCCESS)
        {
          if (localCursor.getSearchKey(key, data, LockMode.DEFAULT) != SUCCESS)
          // We could not move the cursor to the expected startCSN
          if (localCursor.getSearchKeyRange(key, data, DEFAULT) != SUCCESS)
          {
            // We could not move the cursor to the expected startCSN
            if (localCursor.getSearchKeyRange(key, data, DEFAULT) != SUCCESS)
            {
              // We could not even move the cursor close to it => failure
              throw new ChangelogException(Message.raw("CSN not available"));
            }
            // We could not even move the cursor close to it => failure
            throw new ChangelogException(Message.raw("CSN not available"));
          }
            // We can move close to the startCSN.
            // Let's create a cursor from that point.
            DatabaseEntry aKey = new DatabaseEntry();
            DatabaseEntry aData = new DatabaseEntry();
            if (localCursor.getPrev(aKey, aData, LockMode.DEFAULT) != SUCCESS)
            {
              localCursor.close();
              localCursor = db.openCursor(txn, null);
            }
          // We can move close to the startCSN.
          // Let's create a cursor from that point.
          DatabaseEntry aKey = new DatabaseEntry();
          DatabaseEntry aData = new DatabaseEntry();
          if (localCursor.getPrev(aKey, aData, LockMode.DEFAULT) != SUCCESS)
          {
            localCursor.close();
            localCursor = db.openCursor(txn, null);
          }
        }
        cursor = localCursor;
@@ -892,7 +891,7 @@
    catch(Exception e)
    {
      MessageBuilder mb = new MessageBuilder();
      mb.append(ERR_ERROR_CLEARING_DB.get(this.toString(),
      mb.append(ERR_ERROR_CLEARING_DB.get(toString(),
          e.getMessage() + " " +
          stackTraceToSingleLineString(e)));
      logError(mb.toMessage());