WE SERIOUSLY NEED TO FIX THIS ISSUE AT SOME POINT

(THIS IS NOT THE OFFICIAL FIX, JUST A TEMPORARY THING)
This commit is contained in:
boy0001 2014-12-14 12:12:21 +11:00
parent f0d2fd93dd
commit 8e6608d613

View File

@ -66,6 +66,8 @@ public class SQLManager implements AbstractDB {
// Private final // Private final
connection = c; connection = c;
prefix = p; prefix = p;
// Set timout
setTimout();
// Public final // Public final
SET_OWNER = SET_OWNER =
"UPDATE `" + prefix + "plot` SET `owner` = ? WHERE `plot_id_x` = ? AND `plot_id_z` = ?"; "UPDATE `" + prefix + "plot` SET `owner` = ? WHERE `plot_id_x` = ? AND `plot_id_z` = ?";
@ -81,6 +83,22 @@ public class SQLManager implements AbstractDB {
"INSERT INTO `" + prefix + "plot`(`plot_id_x`, `plot_id_z`, `owner`, `world`) VALUES(?, ?, ?, ?)"; "INSERT INTO `" + prefix + "plot`(`plot_id_x`, `plot_id_z`, `owner`, `world`) VALUES(?, ?, ?, ?)";
} }
public void setTimout() {
runTask(new Runnable() {
@Override
public void run() {
try {
final PreparedStatement statement = connection.prepareStatement("SET GLOBAL wait_timeout =28800;");
statement.executeUpdate();
statement.close();
} catch (final SQLException e) {
e.printStackTrace();
Logger.add(LogLevel.DANGER, "Could not reset MySQL timout.");
}
}
});
}
/** /**
* Set Plot owner * Set Plot owner
* *
@ -265,6 +283,10 @@ public class SQLManager implements AbstractDB {
*/ */
@Override @Override
public void createTables(final String database, final boolean add_constraint) throws SQLException { public void createTables(final String database, final boolean add_constraint) throws SQLException {
final boolean mysql = database.equals("mysql"); final boolean mysql = database.equals("mysql");
final Statement stmt = connection.createStatement(); final Statement stmt = connection.createStatement();
if (mysql) { if (mysql) {