Search in sources :

Example 1 with LogSqlBuilder

use of org.jumpmind.db.sql.LogSqlBuilder in project symmetric-ds by JumpMind.

the class ClientSymmetricEngine method createSqlTemplateSettings.

protected static SqlTemplateSettings createSqlTemplateSettings(TypedProperties properties) {
    SqlTemplateSettings settings = new SqlTemplateSettings();
    settings.setFetchSize(properties.getInt(ParameterConstants.DB_FETCH_SIZE, 1000));
    settings.setQueryTimeout(properties.getInt(ParameterConstants.DB_QUERY_TIMEOUT_SECS, 300));
    settings.setBatchSize(properties.getInt(ParameterConstants.JDBC_EXECUTE_BATCH_SIZE, 100));
    settings.setOverrideIsolationLevel(properties.getInt(ParameterConstants.JDBC_ISOLATION_LEVEL, -1));
    settings.setReadStringsAsBytes(properties.is(ParameterConstants.JDBC_READ_STRINGS_AS_BYTES, false));
    LogSqlBuilder logSqlBuilder = new LogSqlBuilder();
    logSqlBuilder.setLogSlowSqlThresholdMillis(properties.getInt(ParameterConstants.LOG_SLOW_SQL_THRESHOLD_MILLIS, 20000));
    logSqlBuilder.setLogSqlParametersInline(properties.is(ParameterConstants.LOG_SQL_PARAMETERS_INLINE, true));
    settings.setLogSqlBuilder(logSqlBuilder);
    if (settings.getOverrideIsolationLevel() >= 0) {
        log.info("Overriding isolation level to " + settings.getOverrideIsolationLevel());
    }
    return settings;
}
Also used : LogSqlBuilder(org.jumpmind.db.sql.LogSqlBuilder) SqlTemplateSettings(org.jumpmind.db.sql.SqlTemplateSettings)

Aggregations

LogSqlBuilder (org.jumpmind.db.sql.LogSqlBuilder)1 SqlTemplateSettings (org.jumpmind.db.sql.SqlTemplateSettings)1