Skip to content

Commit

Permalink
0003055: When the default database writer fails to execute a SQL event,
Browse files Browse the repository at this point in the history
the SQL that was executed is not logged
  • Loading branch information
chenson42 committed Apr 14, 2017
1 parent 155fbf7 commit e1555f8
Showing 1 changed file with 13 additions and 9 deletions.
Expand Up @@ -533,15 +533,19 @@ protected boolean sql(CsvData data) {
List<String> sqlStatements = getSqlStatements(script);
long count = 0;
for (String sql : sqlStatements) {

sql = preprocessSqlStatement(sql);
transaction.prepare(sql);
if (log.isDebugEnabled()) {
log.debug("About to run: {}", sql);
}
count += transaction.prepareAndExecute(sql);
if (log.isDebugEnabled()) {
log.debug("{} rows updated when running: {}", count, sql);
try {
sql = preprocessSqlStatement(sql);
transaction.prepare(sql);
if (log.isDebugEnabled()) {
log.debug("About to run: {}", sql);
}
count += transaction.prepareAndExecute(sql);
if (log.isDebugEnabled()) {
log.debug("{} rows updated when running: {}", count, sql);
}
} catch (RuntimeException ex) {
log.error("Failed to run the following sql: {}", sql);
throw ex;
}
}
statistics.get(batch).increment(DataWriterStatisticConstants.SQLCOUNT);
Expand Down

0 comments on commit e1555f8

Please sign in to comment.