   Creates a database or opens existing one from the folder specified by argument
   "
   [path]
-  (let [dbinstance (HGEnvironment/get path)]
+  (def config (HGConfiguration.))
+  (def handleFactory (SequentialUUIDHandleFactory. (System/currentTimeMillis) 0))
+  (. config setHandleFactory handleFactory)
+  (. config setTransactional false)
+  (def storeConfig (. (. config getStoreImplementation) getConfiguration))
+  (. (. storeConfig getEnvironmentConfig) setCacheSize (* (* 1024 1024) 500))
+  (let [dbinstance (HGEnvironment/get path config)]
     (reset! database dbinstance)))
 
 (defn close-database

(ns forumdb.core
  (:import [org.hypergraphdb HGEnvironment HGHandle HGPlainLink HGQuery$hg HGQuery HGValueLink]
           (java.util Locale TimeZone)
           (java.text SimpleDateFormat)
           (java.io File)

           (org.joda.time DateTime)
           (org.hypergraphdb.atom HGRel HGRelType)
           (org.hypergraphdb.query HGQueryCondition AtomPartRegExPredicate)
           (java.util.regex Pattern)
           (org.hypergraphdb.indexing ByPartIndexer)
           (org.hypergraphdb.handle SequentialUUIDHandleFactory))
  (:require [clojure.string :as string]
            [clojure.xml :as xml]
            [clj-time.format :as f]
