Skip to content

Commit

Permalink
[oracle] close the oracle connection after the backfill task finished
Browse files Browse the repository at this point in the history
  • Loading branch information
ruanhang1993 committed Jun 30, 2023
1 parent 26b4445 commit 1ab9741
Showing 1 changed file with 1 addition and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
import io.debezium.pipeline.source.spi.ChangeEventSource;
import io.debezium.pipeline.source.spi.SnapshotProgressListener;
import io.debezium.pipeline.spi.ChangeRecordEmitter;
import io.debezium.pipeline.spi.OffsetContext;
import io.debezium.pipeline.spi.SnapshotResult;
import io.debezium.relational.RelationalSnapshotChangeEventSource;
import io.debezium.relational.SnapshotChangeRecordEmitter;
Expand All @@ -59,7 +58,6 @@
import java.util.Map;

import static com.ververica.cdc.connectors.oracle.source.reader.fetch.OracleStreamFetchTask.RedoLogSplitReadTask;
import static com.ververica.cdc.connectors.oracle.source.utils.OracleConnectionUtils.createOracleConnection;
import static com.ververica.cdc.connectors.oracle.source.utils.OracleConnectionUtils.currentRedoLogOffset;
import static com.ververica.cdc.connectors.oracle.source.utils.OracleUtils.buildSplitScanQuery;
import static com.ververica.cdc.connectors.oracle.source.utils.OracleUtils.readTableSplitDataStatement;
Expand Down Expand Up @@ -163,10 +161,6 @@ private StreamSplit createBackfillRedoLogSplit(

private RedoLogSplitReadTask createBackfillRedoLogReadTask(
StreamSplit backfillBinlogSplit, OracleSourceFetchTaskContext context) {
OracleConnectorConfig oracleConnectorConfig =
context.getSourceConfig().getDbzConnectorConfig();
final OffsetContext.Loader<OracleOffsetContext> loader =
new LogMinerOracleOffsetContextLoader(oracleConnectorConfig);
// we should only capture events for the current table,
// otherwise, we may can't find corresponding schema
Configuration dezConf =
Expand All @@ -180,7 +174,7 @@ private RedoLogSplitReadTask createBackfillRedoLogReadTask(
// task to read binlog and backfill for current split
return new RedoLogSplitReadTask(
new OracleConnectorConfig(dezConf),
createOracleConnection(context.getSourceConfig().getDbzConfiguration()),
context.getConnection(),
context.getDispatcher(),
context.getErrorHandler(),
context.getDatabaseSchema(),
Expand Down

0 comments on commit 1ab9741

Please sign in to comment.