{"record":{"id":"d83b89f529249293","repo":"apache/seatunnel","slug":"not-applicable-when-using-read-only-flushing-strat","errorCode":null,"errorMessage":"Not applicable when using read-only flushing strategy","messagePattern":"Not applicable when using read-only flushing strategy","errorType":"exception","errorClass":"DebeziumException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-cdc/connector-cdc-oracle/src/main/java/io/debezium/connector/oracle/logminer/logwriter/ReadOnlyLogWriterFlushStrategy.java","lineNumber":26,"sourceCode":" *\n *    http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage io.debezium.connector.oracle.logminer.logwriter;\n\nimport io.debezium.DebeziumException;\nimport io.debezium.connector.oracle.Scn;\n\npublic class ReadOnlyLogWriterFlushStrategy implements LogWriterFlushStrategy {\n    @Override\n    public String getHost() {\n        throw new DebeziumException(\"Not applicable when using read-only flushing strategy\");\n    }\n\n    @Override\n    public void flush(Scn currentScn) throws InterruptedException {\n        // no operation\n    }\n\n    @Override\n    public void close() throws Exception {\n        // no operation\n    }\n}\n","sourceCodeStart":8,"sourceCodeEnd":39,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-cdc/connector-cdc-oracle/src/main/java/io/debezium/connector/oracle/logminer/logwriter/ReadOnlyLogWriterFlushStrategy.java#L8-L39","documentation":"ReadOnlyLogWriterFlushStrategy is the no-op flush strategy used when the Oracle connector runs with a read-only (LogMiner-only) mining user. Its getHost method is intentionally unsupported — the read-only strategy never flushes the log writer buffer, so asking for the log writer host is meaningless and always throws this DebeziumException. flush() is a no-op by design.","triggerScenarios":"Calling getHost() on the configured LogWriterFlushStrategy while log.mining.strategy is set to 'read_only' (or default online_catalog read-only usage), typically from custom code or another component probing the flush strategy host.","commonSituations":"Custom tooling or extensions that call getHost() on the strategy without checking the strategy type; mixing read-only strategy with code paths written for the default log-writer flush strategy; switching from 'redo_log_catalog'/'default' to 'online_catalog' strategy while retaining host-probing logic.","solutions":["Don't call getHost() when using the read-only mining strategy; check instanceof ReadOnlyLogWriterFlushStrategy first.","If host-based flushing is required, switch log.mining.strategy back to the default (redo_log_catalog) and use 'default' log.mining.query.filter.mode flushing.","Use strategy.flush(scn) semantics instead — under read-only it's a deliberate no-op; configure log.mining.flush.interval.ms appropriately for the default strategy."],"exampleFix":"// before\nString host = flushStrategy.getHost();\n// after\nif (!(flushStrategy instanceof ReadOnlyLogWriterFlushStrategy)) {\n    String host = flushStrategy.getHost();\n}","handlingStrategy":"type-guard","validationCode":null,"typeGuard":"boolean flushable = !(strategy instanceof ReadOnlyLogWriterFlushStrategy);\nif (flushable) { String host = strategy.getHost(); }","tryCatchPattern":"try {\n    host = strategy.getHost();\n} catch (DebeziumException e) {\n    if (e.getMessage().contains(\"read-only flushing strategy\")) {\n        host = null; // read-only strategy: flushing is a no-op\n    } else { throw e; }\n}","preventionTips":["Check the strategy type before calling getHost()/flush-based APIs","Align custom code with the configured log.mining.strategy","Treat flush() on the read-only strategy as an intentional no-op"],"tags":["oracle","cdc","logminer","read-only","flush-strategy"],"backgroundTag":"unsupported-operation","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}