diff --git a/src/org/jgroups/protocols/raft/LevelDBLog.java b/src/org/jgroups/protocols/raft/LevelDBLog.java
index <HASH>..<HASH> 100644
--- a/src/org/jgroups/protocols/raft/LevelDBLog.java
+++ b/src/org/jgroups/protocols/raft/LevelDBLog.java
@@ -139,10 +139,11 @@ public class LevelDBLog implements Log {
                 updateLastAppended(index, batch);
                 updateCurrentTerm(entry.term, batch);
 
-                log.trace("Flushing batch to DB: %s", batch);
-                db.write(batch);
+
                 index++;
             }
+            log.trace("Flushing batch to DB: %s", batch);
+            db.write(batch);
         }
         catch(Exception ex) {
         }
LevelDB: closing batch at end of loop (<URL>)