Search in sources :

Example 1 with DatabaseExecutionStrategy

use of org.flywaydb.core.internal.database.DatabaseExecutionStrategy in project flyway by flyway.

the class SqlMigrationExecutor method execute.

@Override
public void execute(final Context context) throws SQLException {
    DatabaseType databaseType = DatabaseTypeRegister.getDatabaseTypeForConnection(context.getConnection());
    DatabaseExecutionStrategy strategy = databaseType.createExecutionStrategy(context.getConnection());
    strategy.execute(() -> {
        executeOnce(context);
        return true;
    });
}
Also used : DatabaseType(org.flywaydb.core.internal.database.DatabaseType) DatabaseExecutionStrategy(org.flywaydb.core.internal.database.DatabaseExecutionStrategy)

Example 2 with DatabaseExecutionStrategy

use of org.flywaydb.core.internal.database.DatabaseExecutionStrategy in project flyway by flyway.

the class JavaMigrationExecutor method execute.

@Override
public void execute(final Context context) throws SQLException {
    DatabaseType databaseType = DatabaseTypeRegister.getDatabaseTypeForConnection(context.getConnection());
    DatabaseExecutionStrategy strategy = databaseType.createExecutionStrategy(context.getConnection());
    strategy.execute(() -> {
        executeOnce(context);
        return true;
    });
}
Also used : DatabaseType(org.flywaydb.core.internal.database.DatabaseType) DatabaseExecutionStrategy(org.flywaydb.core.internal.database.DatabaseExecutionStrategy)

Aggregations

DatabaseExecutionStrategy (org.flywaydb.core.internal.database.DatabaseExecutionStrategy)2 DatabaseType (org.flywaydb.core.internal.database.DatabaseType)2