Skip to content

Commit a8edd66

Browse files
authored
Merge pull request #348 from data-integrations/exc_handling
[PLUGIN-1514] When database write transaction failed we should fail the pipeline
2 parents c034bcd + 087c2ac commit a8edd66

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

database-commons/src/main/java/io/cdap/plugin/db/batch/sink/ETLDBOutputFormat.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ public void close(TaskAttemptContext context) throws IOException {
115115
}
116116

117117
@Override
118-
public void write(K key, V value) {
118+
public void write(K key, V value) throws IOException {
119119
emptyData = false;
120120
//We need to make correct logging to avoid losing information about error
121121
try {
@@ -129,7 +129,7 @@ public void write(K key, V value) {
129129
getStatement().executeBatch();
130130
}
131131
} catch (SQLException e) {
132-
LOG.warn("Failed to write value to database", e);
132+
throw new IOException(e);
133133
}
134134
}
135135
};

0 commit comments

Comments
 (0)