Merge pull request #2525 from FOCONIS/db2/truncate

DB2: truncate needs commit after each statement
This commit is contained in:
Rob Bygrave
2022-01-29 15:13:29 +13:00
committed by GitHub
@@ -613,6 +613,10 @@ public final class DefaultServer implements SpiServer, SpiEbeanServer {
try (Connection connection = dataSource().getConnection()) {
for (String table : tables) {
executeSql(connection, databasePlatform.truncateStatement(table));
if (databasePlatform.getPlatform().base() == Platform.DB2) {
// DB2 requires commit after each truncate statement
connection.commit();
}
}
connection.commit();
} catch (SQLException e) {