NoteDbUpdateManager: Clear temp inserter right after flushing

Change-Id: I1f9296981887d5e7757fcc909db1d48e35256c41
This commit is contained in:
Dave Borowitz
2017-04-13 12:57:03 -04:00
parent 4004a68609
commit 93899b4b86

View File

@@ -170,7 +170,6 @@ public class NoteDbUpdateManager implements AutoCloseable {
void flush() throws IOException { void flush() throws IOException {
flushToFinalInserter(); flushToFinalInserter();
finalIns.flush(); finalIns.flush();
tempIns.clear();
} }
void flushToFinalInserter() throws IOException { void flushToFinalInserter() throws IOException {
@@ -178,6 +177,7 @@ public class NoteDbUpdateManager implements AutoCloseable {
for (InsertedObject obj : tempIns.getInsertedObjects()) { for (InsertedObject obj : tempIns.getInsertedObjects()) {
finalIns.insert(obj.type(), obj.data().toByteArray()); finalIns.insert(obj.type(), obj.data().toByteArray());
} }
tempIns.clear();
} }
@Override @Override