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

Jean-Noel Rouvignac
05.17.2014 12262caeda60050c11b1c730fc9b02ed86a55fcf
opendj3-server-dev/src/server/org/opends/server/backends/jeb/DN2ID.java
@@ -64,36 +64,12 @@
    comparator = new AttributeIndex.KeyComparator();
    prefixRDNComponents = entryContainer.getBaseDN().size();
    DatabaseConfig dn2idConfig = new DatabaseConfig();
    if(env.getConfig().getReadOnly())
    {
      dn2idConfig.setReadOnly(true);
      dn2idConfig.setAllowCreate(false);
      dn2idConfig.setTransactional(false);
    }
    else if(!env.getConfig().getTransactional())
    {
      dn2idConfig.setAllowCreate(true);
      dn2idConfig.setTransactional(false);
      dn2idConfig.setDeferredWrite(true);
    }
    else
    {
      dn2idConfig.setAllowCreate(true);
      dn2idConfig.setTransactional(true);
    }
    this.dbConfig = dn2idConfig;
    this.dbConfig = JEBUtils.toDatabaseConfigNoDuplicates(env);
    this.dbConfig.setKeyPrefixing(true);
    //This line causes an unchecked cast error if the SuppressWarnings
    //annotation is removed at the beginning of this method.
    this.dbConfig.setBtreeComparator((Class<? extends Comparator<byte[]>>) comparator.getClass());
  }
  /**
   * Insert a new record into the DN database.
   * @param txn A JE database transaction to be used for the database operation,