forked from Qortal/qortal
Fix HSQLDB backups.
Change AutoUpdate to use 'quick' backup. For HSQLDBRepository.backup, don't perform CHECKPOINT DEFRAG while repository in use as it never completes. Similarly, use BACKUP DATABASE ... NOT BLOCKING.
This commit is contained in:
parent
8109214087
commit
9c1ca8de04
@ -213,7 +213,7 @@ public class AutoUpdate extends Thread {
|
||||
}
|
||||
|
||||
// Give repository a chance to backup in case things go badly wrong
|
||||
RepositoryManager.backup(false);
|
||||
RepositoryManager.backup(true);
|
||||
|
||||
// Call ApplyUpdate to end this process (unlocking current JAR so it can be replaced)
|
||||
String javaHome = System.getProperty("java.home");
|
||||
|
@ -238,9 +238,7 @@ public class HSQLDBRepository implements Repository {
|
||||
public void backup(boolean quick) throws DataException {
|
||||
// First perform a CHECKPOINT
|
||||
try {
|
||||
if (quick)
|
||||
this.connection.createStatement().execute("CHECKPOINT");
|
||||
else
|
||||
if (!quick)
|
||||
this.connection.createStatement().execute("CHECKPOINT DEFRAG");
|
||||
} catch (SQLException e) {
|
||||
throw new DataException("Unable to prepare repository for backup");
|
||||
@ -272,7 +270,7 @@ public class HSQLDBRepository implements Repository {
|
||||
|
||||
// Actually create backup
|
||||
try {
|
||||
this.connection.createStatement().execute("BACKUP DATABASE TO 'backup/' BLOCKING AS FILES");
|
||||
this.connection.createStatement().execute("BACKUP DATABASE TO 'backup/' NOT BLOCKING AS FILES");
|
||||
} catch (SQLException e) {
|
||||
throw new DataException("Unable to backup repository");
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user