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

Jean-Noel Rouvignac
19.49.2014 e125c2b257b8664c2ecb6b775c659836b70bac0f
OPENDJ-1602 New pluggable storage based backend

EntryContainer.java:
In fetchBaseEntry(), fixed the call to getEntry() by passing in the txn.
1 files modified
35 ■■■■■ changed files
opendj-sdk/opendj3-server-dev/src/server/org/opends/server/backends/pluggable/EntryContainer.java 35 ●●●●● patch | view | raw | blame | history
opendj-sdk/opendj3-server-dev/src/server/org/opends/server/backends/pluggable/EntryContainer.java
@@ -1971,8 +1971,27 @@
   *                            the entry.
   * @throws StorageRuntimeException An error occurred during a database operation.
   */
  public Entry getEntry(final DN entryDN)
  throws StorageRuntimeException, DirectoryException
  public Entry getEntry(final DN entryDN) throws StorageRuntimeException, DirectoryException
  {
    try
    {
      return storage.read(new ReadOperation<Entry>()
      {
        @Override
        public Entry run(ReadableStorage txn) throws Exception
        {
          return getEntry0(txn, entryDN);
        }
      });
    }
    catch (Exception e)
    {
      throw new StorageRuntimeException(e);
    }
  }
  private Entry getEntry0(ReadableStorage txn, final DN entryDN) throws StorageRuntimeException, DirectoryException
  {
    final EntryCache<?> entryCache = DirectoryServer.getEntryCache();
    Entry entry = null;
@@ -1987,11 +2006,6 @@
    {
      try
      {
        return storage.read(new ReadOperation<Entry>()
        {
          @Override
          public Entry run(ReadableStorage txn) throws Exception
          {
            // Read dn2id.
            EntryID entryID = dn2id.get(txn, entryDN, false);
            if (entryID == null)
@@ -2007,8 +2021,7 @@
            if (entry2 == null)
            {
              // The entryID does not exist.
              throw new DirectoryException(DirectoryServer.getServerErrorResultCode(), ERR_JEB_MISSING_ID2ENTRY_RECORD
                  .get(entryID));
          throw new DirectoryException(getServerErrorResultCode(), ERR_JEB_MISSING_ID2ENTRY_RECORD.get(entryID));
            }
            // Put the entry in the cache making sure not to overwrite
@@ -2020,8 +2033,6 @@
            }
            return entry2;
          }
        });
      }
      catch (Exception e)
      {
        throw new StorageRuntimeException(e);
@@ -3308,7 +3319,7 @@
    Entry baseEntry = null;
    try
    {
      baseEntry = getEntry(baseDN);
      baseEntry = getEntry0(txn, baseDN);
    }
    catch (Exception e)
    {