diff --git a/src/main/java/it/cavallium/dbengine/lucene/LMDBArray.java b/src/main/java/it/cavallium/dbengine/lucene/LMDBArray.java index df0c240..bf9c63a 100644 --- a/src/main/java/it/cavallium/dbengine/lucene/LMDBArray.java +++ b/src/main/java/it/cavallium/dbengine/lucene/LMDBArray.java @@ -17,9 +17,6 @@ import org.lmdbjava.Txn; public class LMDBArray implements IArray, Closeable { - private static final boolean FORCE_SYNC = false; - private static final boolean DONT_MERGE_TXNS = true; - private static final AtomicLong NEXT_LMDB_ARRAY_ID = new AtomicLong(0); private final AtomicBoolean closed = new AtomicBoolean(); @@ -43,11 +40,7 @@ public class LMDBArray implements IArray, Closeable { this.defaultValue = defaultValue; this.writing = true; - if (DONT_MERGE_TXNS) { - this.rwTxn = null; - } else { - this.rwTxn = this.env.txnWrite(); - } + this.rwTxn = null; this.readTxn = null; this.virtualSize = size; } @@ -80,10 +73,6 @@ public class LMDBArray implements IArray, Closeable { rwTxn.close(); rwTxn = null; } - if (FORCE_SYNC) { - env.sync(true); - } - assert rwTxn == null; assert readTxn == null; readTxn = env.txnRead(); } @@ -91,20 +80,17 @@ public class LMDBArray implements IArray, Closeable { } private void endMode() { - if (DONT_MERGE_TXNS) { - writing = true; - if (readTxn != null) { - readTxn.commit(); - readTxn.close(); - readTxn = null; - } - if (rwTxn != null) { - rwTxn.commit(); - rwTxn.close(); - rwTxn = null; - } + writing = true; + if (readTxn != null) { + readTxn.commit(); + readTxn.close(); + readTxn = null; + } + if (rwTxn != null) { + rwTxn.commit(); + rwTxn.close(); + rwTxn = null; } - assert rwTxn == null; assert readTxn == null; } diff --git a/src/main/java/it/cavallium/dbengine/lucene/LMDBPriorityQueue.java b/src/main/java/it/cavallium/dbengine/lucene/LMDBPriorityQueue.java index c5e2b1d..f872a71 100644 --- a/src/main/java/it/cavallium/dbengine/lucene/LMDBPriorityQueue.java +++ b/src/main/java/it/cavallium/dbengine/lucene/LMDBPriorityQueue.java @@ -27,9 +27,6 @@ import reactor.util.function.Tuples; public class LMDBPriorityQueue implements PriorityQueue, Reversable>, ReversableResourceIterable { - private static final boolean FORCE_SYNC = false; - private static final boolean DONT_MERGE_TXNS = true; - private static final AtomicLong NEXT_LMDB_QUEUE_ID = new AtomicLong(0); private static final AtomicLong NEXT_ITEM_UID = new AtomicLong(0); @@ -56,11 +53,7 @@ public class LMDBPriorityQueue implements PriorityQueue, Reversable implements PriorityQueue, Reversable implements PriorityQueue, Reversable