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

pgamba
20.46.2007 3298001b86b35e1a05ff9d6a2f0ac402d674400a
opends/src/server/org/opends/server/replication/server/ReplicationCache.java
@@ -1037,42 +1037,7 @@
      if (this.generationId != newGenId)
      {
        // Reset the localchange and state db for the current domain
        synchronized (sourceDbHandlers)
        {
          for (DbHandler dbHandler : sourceDbHandlers.values())
          {
            try
            {
              dbHandler.clear();
            }
            catch (Exception e)
            {
              // TODO: i18n
              logError(Message.raw(
                  "Exception caught while clearing dbHandler:" +
                  e.getLocalizedMessage()));
            }
          }
          sourceDbHandlers.clear();
          if (debugEnabled())
            TRACER.debugInfo(
                "In " + this.replicationServer.getMonitorInstanceName() +
                " baseDN=" + baseDn +
            " The source db handler has been cleared");
        }
        try
        {
          replicationServer.clearGenerationId(baseDn);
        }
        catch (Exception e)
        {
          // TODO: i18n
          logError(Message.raw(
              "Exception caught while clearing generationId:" +
              e.getLocalizedMessage()));
        }
        clearDbs();
        // Reset the in memory domain generationId
        generationId = newGenId;
@@ -1080,6 +1045,49 @@
    }
    /**
     * Clears the Db associated with that cache.
     */
    public void clearDbs()
    {
      // Reset the localchange and state db for the current domain
      synchronized (sourceDbHandlers)
      {
        for (DbHandler dbHandler : sourceDbHandlers.values())
        {
          try
          {
            dbHandler.clear();
          }
          catch (Exception e)
          {
            // TODO: i18n
            logError(Message.raw(
                "Exception caught while clearing dbHandler:" +
                e.getLocalizedMessage()));
          }
        }
        sourceDbHandlers.clear();
        if (debugEnabled())
          TRACER.debugInfo(
              "In " + this.replicationServer.getMonitorInstanceName() +
              " baseDN=" + baseDn +
          " The source db handler has been cleared");
      }
      try
      {
        replicationServer.clearGenerationId(baseDn);
      }
      catch (Exception e)
      {
        // TODO: i18n
        logError(Message.raw(
            "Exception caught while clearing generationId:" +
            e.getLocalizedMessage()));
      }
    }
    /**
     * Returns whether the provided server is in degraded
     * state due to the fact that the peer server has an invalid
     * generationId for this domain.