Fixed WAL checkpointing not running on some systems
This commit is contained in:
parent
d97f5482ee
commit
92e030f3e8
2 changed files with 10 additions and 1 deletions
|
|
@ -73,8 +73,10 @@ public class Process {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Consumer.isPaused = true;
|
|
||||||
Statement statement = connection.createStatement();
|
Statement statement = connection.createStatement();
|
||||||
|
Database.performCheckpoint(statement);
|
||||||
|
|
||||||
|
Consumer.isPaused = true;
|
||||||
ArrayList<Object[]> consumerData = Consumer.consumer.get(processId);
|
ArrayList<Object[]> consumerData = Consumer.consumer.get(processId);
|
||||||
Map<Integer, String[]> users = Consumer.consumerUsers.get(processId);
|
Map<Integer, String[]> users = Consumer.consumerUsers.get(processId);
|
||||||
Map<Integer, Object> consumerObject = Consumer.consumerObjects.get(processId);
|
Map<Integer, Object> consumerObject = Consumer.consumerObjects.get(processId);
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@ import java.sql.Connection;
|
||||||
import java.sql.DriverManager;
|
import java.sql.DriverManager;
|
||||||
import java.sql.PreparedStatement;
|
import java.sql.PreparedStatement;
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
|
import java.sql.SQLException;
|
||||||
import java.sql.Statement;
|
import java.sql.Statement;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
|
@ -88,6 +89,12 @@ public class Database extends Queue {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void performCheckpoint(Statement statement) throws SQLException {
|
||||||
|
if (!Config.getGlobal().MYSQL) {
|
||||||
|
statement.executeUpdate("PRAGMA wal_checkpoint(TRUNCATE)");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static void setMultiInt(PreparedStatement statement, int value, int count) {
|
public static void setMultiInt(PreparedStatement statement, int value, int count) {
|
||||||
try {
|
try {
|
||||||
for (int i = 1; i <= count; i++) {
|
for (int i = 1; i <= count; i++) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue