File tree Expand file tree Collapse file tree
src/main/java/com/dre/brewery/storage/impls Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -82,10 +82,6 @@ public MySQLStorage(ConfiguredDataManager record) throws StorageInitException {
8282
8383
8484 try (Connection connection = source .getConnection ()) {
85- try (PreparedStatement statement = connection .prepareStatement ("USE " + record .getDatabase ())) {
86- statement .execute ();
87- }
88-
8985 for (String table : TABLES ) {
9086 try (PreparedStatement statement = connection .prepareStatement ("CREATE TABLE IF NOT EXISTS " + tablePrefix + table )) {
9187 statement .execute ();
@@ -168,10 +164,9 @@ public <T extends SerializableThing> void saveAllGeneric(List<T> serializableThi
168164 String deleteOldRecordsSql = "DELETE FROM " + tablePrefix + table + " WHERE id NOT IN (SELECT id FROM temp_" + table + ")" ;
169165
170166 try (Connection connection = source .getConnection ()) {
171-
167+ connection . setAutoCommit ( false );
172168 try (PreparedStatement createTempTableStmt = connection .prepareStatement (createTempTableSql );
173169 PreparedStatement insertTempTableStmt = connection .prepareStatement (insertTempTableSql )) {
174-
175170 createTempTableStmt .execute ();
176171
177172 for (SerializableThing serializableThing : serializableThings ) {
You can’t perform that action at this time.
0 commit comments