From 1aaff4e2b0b2f3b467996b88177b2c58f95146dc Mon Sep 17 00:00:00 2001 From: Intelli Date: Mon, 28 Feb 2022 17:47:07 -0700 Subject: [PATCH] Enabled write-ahead logging for SQLite --- src/main/java/net/coreprotect/database/Database.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/net/coreprotect/database/Database.java b/src/main/java/net/coreprotect/database/Database.java index 567a4ea..3ca5cb1 100755 --- a/src/main/java/net/coreprotect/database/Database.java +++ b/src/main/java/net/coreprotect/database/Database.java @@ -294,6 +294,10 @@ public class Database extends Queue { private static void initializeTables(String prefix, Statement statement) { try { + if (!Config.getGlobal().MYSQL) { + statement.executeUpdate("PRAGMA journal_mode=WAL;"); + } + boolean lockInitialized = false; String query = "SELECT rowid as id FROM " + prefix + "database_lock WHERE rowid='1' LIMIT 1"; ResultSet rs = statement.executeQuery(query);