From f4fc21a222c514860b5232cce2d9f890639f5b5a Mon Sep 17 00:00:00 2001
From: Fabio Pistolesi <fabio.pistolesi@forgerock.com>
Date: Mon, 27 Jul 2015 09:38:19 +0000
Subject: [PATCH] OPENDJ-2159 CR-7527 PDB Storage is read-only when using verify-index tool on Windows.

---
 opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/AttributeIndex.java |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/AttributeIndex.java b/opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/AttributeIndex.java
index 3ab3628..9393763 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/AttributeIndex.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/AttributeIndex.java
@@ -334,13 +334,14 @@
    * Open the attribute index.
    *
    * @param txn a non null transaction
+   * @param createOnDemand true if the tree should be created if it does not exist
    * @throws StorageRuntimeException if an error occurs while opening the index
    */
-  void open(WriteableTransaction txn) throws StorageRuntimeException
+  void open(WriteableTransaction txn, boolean createOnDemand) throws StorageRuntimeException
   {
     for (Index index : indexIdToIndexes.values())
     {
-      index.open(txn);
+      index.open(txn, createOnDemand);
     }
     config.addChangeListener(this);
   }
@@ -761,7 +762,7 @@
         {
           for (MatchingRuleIndex addedIndex : addedIndexes.values())
           {
-            openIndex(txn, addedIndex, ccr);
+            createIndex(txn, addedIndex, ccr);
           }
         }
       });
@@ -805,9 +806,9 @@
     return ccr;
   }
 
-  private static void openIndex(WriteableTransaction txn, MatchingRuleIndex index, ConfigChangeResult ccr)
+  private static void createIndex(WriteableTransaction txn, MatchingRuleIndex index, ConfigChangeResult ccr)
   {
-    index.open(txn);
+    index.open(txn, true);
     if (!index.isTrusted())
     {
       ccr.setAdminActionRequired(true);

--
Gitblit v1.10.0