Flush database changes after switching to READONLY mode

This commit is contained in:
Toni Prieto
2023-10-13 20:52:08 +02:00
parent c33d3fa87d
commit 00a65312cc
2 changed files with 9 additions and 14 deletions

View File

@@ -202,10 +202,6 @@ public class IndexEventConsumer implements Consumer {
public void end(Context ctx) throws Exception {
// Change the mode to readonly to improve performance
// First, we flush the changes to database, if session is dirty, has pending changes
// to synchronize with database, without this flush it could index an old version of
// the object
ctx.flushDBChanges();
Context.Mode originalMode = ctx.getCurrentMode();
ctx.setMode(Context.Mode.READ_ONLY);