From 1edd5068bf0b63cbd67c615942ad5c545440d476 Mon Sep 17 00:00:00 2001
From: abobrov <abobrov@localhost>
Date: Tue, 24 Nov 2009 15:14:33 +0000
Subject: [PATCH] - upgrade to BDB JE 4 [ 4.0.73 ]

---
 opends/src/server/org/opends/server/backends/jeb/ConfigurableEnvironment.java |   26 +++++++++++++++-----------
 1 files changed, 15 insertions(+), 11 deletions(-)

diff --git a/opends/src/server/org/opends/server/backends/jeb/ConfigurableEnvironment.java b/opends/src/server/org/opends/server/backends/jeb/ConfigurableEnvironment.java
index 2ef8332..9fcaf4d 100644
--- a/opends/src/server/org/opends/server/backends/jeb/ConfigurableEnvironment.java
+++ b/opends/src/server/org/opends/server/backends/jeb/ConfigurableEnvironment.java
@@ -26,6 +26,7 @@
  */
 package org.opends.server.backends.jeb;
 
+import com.sleepycat.je.Durability;
 import com.sleepycat.je.EnvironmentConfig;
 import com.sleepycat.je.dbi.MemoryBudget;
 
@@ -370,9 +371,6 @@
       registerProp("je.evictor.lruOnly", ATTR_EVICTOR_LRU_ONLY);
       registerProp("je.evictor.nodesPerScan", ATTR_EVICTOR_NODES_PER_SCAN);
       registerProp("je.log.fileMax", ATTR_DATABASE_LOG_FILE_MAX);
-      registerProp("java.util.logging.FileHandler.on",
-                   ATTR_LOGGING_FILE_HANDLER_ON);
-      registerProp("java.util.logging.level", ATTR_LOGGING_LEVEL);
       registerProp("je.checkpointer.bytesInterval",
                    ATTR_CHECKPOINTER_BYTES_INTERVAL);
       registerProp("je.checkpointer.wakeupInterval",
@@ -469,9 +467,20 @@
 
     EnvironmentConfig envConfig = defaultConfig();
 
-    // Handle the attributes that do not have a JE property.
-    envConfig.setTxnNoSync(cfg.isDBTxnNoSync());
-    envConfig.setTxnWriteNoSync(cfg.isDBTxnWriteNoSync());
+    // Durability settings.
+    if (cfg.isDBTxnNoSync() && cfg.isDBTxnWriteNoSync())
+    {
+      throw new ConfigException(
+              ERR_CONFIG_JEB_DURABILITY_CONFLICT.get());
+    }
+    if (cfg.isDBTxnNoSync())
+    {
+      envConfig.setDurability(Durability.COMMIT_NO_SYNC);
+    }
+    if (cfg.isDBTxnWriteNoSync())
+    {
+      envConfig.setDurability(Durability.COMMIT_WRITE_NO_SYNC);
+    }
 
     // Iterate through the config attributes associated with a JE property.
     for (Map.Entry<String, String> mapEntry : attrMap.entrySet())
@@ -534,11 +543,6 @@
         // Set JE property.
         try {
           envConfig.setConfigParam(jePropertyName, jePropertyValue);
-          // This is a special case that JE cannot validate before
-          // actually setting it. Validate it before it gets to JE.
-          if (jePropertyName.equals("java.util.logging.level")) {
-            java.util.logging.Level.parse(jePropertyValue);
-          }
           // If this property shadows an existing config attribute.
           if (configAttrMap.containsKey(jePropertyName)) {
             Message message = ERR_CONFIG_JE_PROPERTY_SHADOWS_CONFIG.get(

--
Gitblit v1.10.0