DB2: truncate needs commit after each statement

This commit is contained in:
Roland Praml
2022-01-28 10:56:01 +01:00
parent 1d11666945
commit 3b30708dfc
@@ -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) {