mirror of
https://github.com/GeorgH93/Minepacks.git
synced 2024-11-28 13:05:14 +01:00
Bugfix SQLITE_BUSY error
This commit is contained in:
parent
55943e65f7
commit
8e0e866b4d
2
.gitignore
vendored
2
.gitignore
vendored
@ -45,6 +45,8 @@ Network Trash Folder
|
|||||||
Temporary Items
|
Temporary Items
|
||||||
.apdisk
|
.apdisk
|
||||||
|
|
||||||
|
# Temp files
|
||||||
|
*.tmp
|
||||||
|
|
||||||
|
|
||||||
# =========================
|
# =========================
|
||||||
|
2
pom.xml
2
pom.xml
@ -3,7 +3,7 @@
|
|||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>at.pcgamingfreaks</groupId>
|
<groupId>at.pcgamingfreaks</groupId>
|
||||||
<artifactId>MinePacks</artifactId>
|
<artifactId>MinePacks</artifactId>
|
||||||
<version>1.17.2</version>
|
<version>1.17.3-SNAPSHOT</version>
|
||||||
|
|
||||||
<scm>
|
<scm>
|
||||||
<connection>scm:git:git@github.com:GeorgH93/Bukkit_Minepacks.git</connection>
|
<connection>scm:git:git@github.com:GeorgH93/Bukkit_Minepacks.git</connection>
|
||||||
|
@ -70,6 +70,7 @@ protected HikariConfig getPoolConfig()
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
HikariConfig poolConfig = new HikariConfig();
|
HikariConfig poolConfig = new HikariConfig();
|
||||||
|
poolConfig.setMaximumPoolSize(1);
|
||||||
poolConfig.setJdbcUrl("jdbc:sqlite:" + plugin.getDataFolder().getAbsolutePath() + File.separator + "backpack.db");
|
poolConfig.setJdbcUrl("jdbc:sqlite:" + plugin.getDataFolder().getAbsolutePath() + File.separator + "backpack.db");
|
||||||
poolConfig.setConnectionTestQuery("SELECT 1;");
|
poolConfig.setConnectionTestQuery("SELECT 1;");
|
||||||
return poolConfig;
|
return poolConfig;
|
||||||
@ -83,7 +84,7 @@ protected void updateQuerysForDialect()
|
|||||||
queryInsertBP = queryInsertBP.replaceAll("\\) VALUES \\(\\?,\\?,\\?", "{FieldBPLastUpdate}) VALUES (?,?,?,DATE('now')");
|
queryInsertBP = queryInsertBP.replaceAll("\\) VALUES \\(\\?,\\?,\\?", "{FieldBPLastUpdate}) VALUES (?,?,?,DATE('now')");
|
||||||
}
|
}
|
||||||
queryDeleteOldBackpacks = "DELETE FROM `{TableBackpacks}` WHERE `{FieldBPLastUpdate}` < DATE('now', '-{VarMaxAge} days')";
|
queryDeleteOldBackpacks = "DELETE FROM `{TableBackpacks}` WHERE `{FieldBPLastUpdate}` < DATE('now', '-{VarMaxAge} days')";
|
||||||
queryUpdateBP = queryUpdateBP.replaceAll("\\{NOW\\}", "DATE('now')");
|
queryUpdateBP = queryUpdateBP.replaceAll("\\{NOW}", "DATE('now')");
|
||||||
if(useUUIDs)
|
if(useUUIDs)
|
||||||
{
|
{
|
||||||
queryUpdatePlayerAdd = "INSERT OR IGNORE INTO `{TablePlayers}` (`{FieldName}`,`{FieldUUID}`) VALUES (?,?);";
|
queryUpdatePlayerAdd = "INSERT OR IGNORE INTO `{TablePlayers}` (`{FieldName}`,`{FieldUUID}`) VALUES (?,?);";
|
||||||
@ -122,9 +123,7 @@ protected void checkDB()
|
|||||||
rs.next();
|
rs.next();
|
||||||
stmt.execute("ALTER TABLE `backpacks` ADD COLUMN `lastupdate` DATE DEFAULT '" + rs.getString(1) + "';");
|
stmt.execute("ALTER TABLE `backpacks` ADD COLUMN `lastupdate` DATE DEFAULT '" + rs.getString(1) + "';");
|
||||||
}
|
}
|
||||||
catch(SQLException ignored)
|
catch(SQLException ignored) {}
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch(SQLException e)
|
catch(SQLException e)
|
||||||
|
Loading…
Reference in New Issue
Block a user