DBZ-4999 Provide hook to allow Informix to avoid blocking

This commit is contained in:
Jiri Pechanec 2023-10-20 08:59:56 +02:00
parent 4beb3ae4dd
commit 13d1b4e0b2

View File

@ -538,7 +538,7 @@ private void doCreateDataEventsForTable(ChangeEventSourceContext sourceContext,
Instant sourceTableSnapshotTimestamp = getSnapshotSourceTimestamp(jdbcConnection, offset, table.id()); Instant sourceTableSnapshotTimestamp = getSnapshotSourceTimestamp(jdbcConnection, offset, table.id());
try (Statement statement = readTableStatement(jdbcConnection, rowCount); try (Statement statement = readTableStatement(jdbcConnection, rowCount);
ResultSet rs = CancellableResultSet.from(statement.executeQuery(selectStatement))) { ResultSet rs = resultSetForDataEvents(selectStatement, statement)) {
ColumnUtils.ColumnArray columnArray = ColumnUtils.toArray(rs, table); ColumnUtils.ColumnArray columnArray = ColumnUtils.toArray(rs, table);
long rows = 0; long rows = 0;
@ -588,6 +588,11 @@ private void doCreateDataEventsForTable(ChangeEventSourceContext sourceContext,
} }
} }
protected ResultSet resultSetForDataEvents(String selectStatement, Statement statement)
throws SQLException {
return CancellableResultSet.from(statement.executeQuery(selectStatement));
}
private void setSnapshotMarker(OffsetContext offset, boolean firstTable, boolean lastTable, boolean firstRecordInTable, private void setSnapshotMarker(OffsetContext offset, boolean firstTable, boolean lastTable, boolean firstRecordInTable,
boolean lastRecordInTable) { boolean lastRecordInTable) {
if (lastRecordInTable && lastTable) { if (lastRecordInTable && lastTable) {