Enabled write-ahead logging for SQLite

This commit is contained in:
Intelli 2022-02-28 17:47:07 -07:00
parent 1c476408e9
commit 1aaff4e2b0

View File

@ -294,6 +294,10 @@ public class Database extends Queue {
private static void initializeTables(String prefix, Statement statement) { private static void initializeTables(String prefix, Statement statement) {
try { try {
if (!Config.getGlobal().MYSQL) {
statement.executeUpdate("PRAGMA journal_mode=WAL;");
}
boolean lockInitialized = false; boolean lockInitialized = false;
String query = "SELECT rowid as id FROM " + prefix + "database_lock WHERE rowid='1' LIMIT 1"; String query = "SELECT rowid as id FROM " + prefix + "database_lock WHERE rowid='1' LIMIT 1";
ResultSet rs = statement.executeQuery(query); ResultSet rs = statement.executeQuery(query);