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

Matthew Swift
26.22.2015 f09c069e92d051036af2a969fe5289cb7c4826ba
opendj-server-legacy/src/main/java/org/opends/server/backends/jeb/JEStorage.java
@@ -101,6 +101,7 @@
import com.sleepycat.je.EnvironmentConfig;
import com.sleepycat.je.OperationStatus;
import com.sleepycat.je.Transaction;
import com.sleepycat.je.TransactionConfig;
/** Berkeley DB Java Edition (JE for short) database implementation of the {@link Storage} engine. */
public final class JEStorage implements Storage, Backupable, ConfigurationChangeListener<JEBackendCfg>,
@@ -171,6 +172,20 @@
    }
    @Override
    public void delete() throws NoSuchElementException, UnsupportedOperationException
    {
      throwIfNotSuccess();
      try
      {
        cursor.delete();
      }
      catch (DatabaseException e)
      {
        throw new StorageRuntimeException(e);
      }
    }
    @Override
    public boolean positionToKey(final ByteSequence key)
    {
      clearCurrentKeyAndValue();
@@ -568,6 +583,10 @@
  }
  private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass();
  /** Use read committed isolation instead of the default which is repeatable read. */
  private static final TransactionConfig TXN_READ_COMMITTED = new TransactionConfig().setReadCommitted(true);
  private final ServerContext serverContext;
  private final File backendDirectory;
  private JEBackendCfg config;
@@ -609,7 +628,7 @@
        tree = trees.get(treeName);
        if (tree == null)
        {
          tree = env.openDatabase(txn, toDatabaseName(treeName), dbConfig());
          tree = env.openDatabase(null, toDatabaseName(treeName), dbConfig());
          trees.put(treeName, tree);
        }
      }
@@ -782,7 +801,7 @@
  {
    if (envConfig.getTransactional())
    {
      final Transaction txn = env.beginTransaction(null, null);
      final Transaction txn = env.beginTransaction(null, TXN_READ_COMMITTED);
      logger.trace("beginTransaction txnid=%d", txn.getId());
      return txn;
    }