mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2025-03-10 13:49:17 +01:00
Reverted some changes
This commit is contained in:
commit
36e9414362
@ -19,6 +19,8 @@ import java.util.Map.Entry;
|
||||
*/
|
||||
public class DBUtils {
|
||||
|
||||
private static final int BATCH_SIZE = 10192;
|
||||
|
||||
/**
|
||||
* Constructor used to hide the public constructor
|
||||
*/
|
||||
@ -26,8 +28,6 @@ public class DBUtils {
|
||||
throw new IllegalStateException("Utility class");
|
||||
}
|
||||
|
||||
private static final int BATCH_SIZE = 10192;
|
||||
|
||||
/**
|
||||
* Splits a collection of objects into lists with the size defined by
|
||||
* BATCH_SIZE.
|
||||
|
@ -117,17 +117,15 @@ public class TPSTable extends Table {
|
||||
* @param data
|
||||
* @throws SQLException
|
||||
*/
|
||||
public void saveTPSData(List<TPS> data) throws SQLException {
|
||||
public void saveTPSData(List<TPS> data) {
|
||||
List<List<TPS>> batches = DBUtils.splitIntoBatches(data);
|
||||
batches.stream()
|
||||
.forEach(batch -> {
|
||||
try {
|
||||
saveTPSBatch(batch);
|
||||
} catch (SQLException e) {
|
||||
Log.toLog("UsersTable.saveUserDataInformationBatch", e);
|
||||
}
|
||||
});
|
||||
commit();
|
||||
batches.forEach(batch -> {
|
||||
try {
|
||||
saveTPSBatch(batch);
|
||||
} catch (SQLException e) {
|
||||
Log.toLog("UsersTable.saveUserDataInformationBatch", e);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void saveTPSBatch(List<TPS> batch) throws SQLException {
|
||||
|
Loading…
Reference in New Issue
Block a user