Fix compilation error

This commit is contained in:
Fuzzlemann 2017-08-23 14:11:50 +02:00
parent 2df6169dd9
commit 8bffdba725
3 changed files with 11 additions and 19 deletions

View File

@ -331,8 +331,6 @@ public abstract class Database {
return serverTable;
}
public abstract void commit() throws SQLException;
public ActionsTable getActionsTable() {
return actionsTable;
}

View File

@ -227,6 +227,7 @@ public abstract class SQLDB extends Database {
if (uuid == null) {
return false;
}
try {
Benchmark.start("Remove Account");
Log.debug("Database", "Removing Account: " + uuid);
@ -237,25 +238,20 @@ public abstract class SQLDB extends Database {
return false;
}
boolean success = true;
for (Table t : getAllTablesInRemoveOrder()) {
if (t instanceof UserIDTable) {
UserIDTable table = (UserIDTable) t;
success = table.removeUser(uuid);
if (!success) {
break;
}
if (!(t instanceof UserIDTable)) {
continue;
}
UserIDTable table = (UserIDTable) t;
if (!table.removeUser(uuid)) {
throw new IllegalStateException("Removal Failed");
}
}
if (success) {
return true;
}
throw new IllegalStateException("Removal Failed");
return true;
} catch (Exception e) {
Log.toLog(this.getClass().getName(), e);
rollback(); // TODO Test case
return false;
} finally {
Benchmark.stop("Database", "Remove Account");

View File

@ -1,11 +1,9 @@
package main.java.com.djrapitops.plan.database.tables;
import com.djrapitops.plugin.utilities.Verify;
import main.java.com.djrapitops.plan.Log;
import main.java.com.djrapitops.plan.database.databases.SQLDB;
import main.java.com.djrapitops.plan.database.sql.Select;
import main.java.com.djrapitops.plan.database.sql.Sql;
import main.java.com.djrapitops.plan.database.sql.TableSqlParser;
import main.java.com.djrapitops.plan.database.sql.Update;
import main.java.com.djrapitops.plan.database.sql.*;
import java.sql.PreparedStatement;
import java.sql.ResultSet;