mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2024-11-09 20:31:38 +01:00
Remove unnecessary .stream() call
Add setAutoCommit(false) at the SQLite connection; Improves speed massively
This commit is contained in:
parent
92e639e7b9
commit
f2cfedf4c9
@ -50,7 +50,9 @@ public class SQLiteDB extends SQLDB {
|
||||
try {
|
||||
Class.forName("org.sqlite.JDBC");
|
||||
|
||||
return DriverManager.getConnection("jdbc:sqlite:" + new File(plugin.getDataFolder(), dbName + ".db").getAbsolutePath());
|
||||
Connection connection = DriverManager.getConnection("jdbc:sqlite:" + new File(plugin.getDataFolder(), dbName + ".db").getAbsolutePath());
|
||||
connection.setAutoCommit(false);
|
||||
return connection;
|
||||
} catch (ClassNotFoundException | SQLException e) {
|
||||
return null;
|
||||
}
|
||||
|
@ -298,7 +298,7 @@ public class GMTimesTable extends Table {
|
||||
|
||||
List<List<Container<GMTimes>>> batches = DBUtils.splitIntoBatchesWithID(gmTimes);
|
||||
|
||||
batches.stream().forEach(batch -> {
|
||||
batches.forEach(batch -> {
|
||||
try {
|
||||
addNewGMTimesBatch(batch);
|
||||
} catch (SQLException e) {
|
||||
|
@ -218,7 +218,7 @@ public class SessionsTable extends Table {
|
||||
|
||||
List<List<Container<SessionData>>> batches = splitIntoBatches(sessions);
|
||||
|
||||
batches.stream().forEach(batch -> {
|
||||
batches.forEach(batch -> {
|
||||
try {
|
||||
saveSessionBatch(batch);
|
||||
} catch (SQLException e) {
|
||||
|
Loading…
Reference in New Issue
Block a user