DB2: truncate needs commit after each statement

This commit is contained in:
Roland Praml
2022-01-07 11:52:34 +01:00
parent da1f8a7fa2
commit ea9481477c
@@ -607,6 +607,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) {