DB2 connector get exception possibly caused by setTransactionIsolation(0) [DBZ-9547]
- Dominant language
- HTML
- Stars
- 6
- Forks
- 8
- Avg merge
- 2d 19h
- Merged PRs (30d)
- 1
Description
Migrated from [DBZ-9547](https://issues.redhat.com/browse/DBZ-9547)
In order to make your issue reports as actionable as possible, please provide the following information, depending on the issue type.
h1. Bug report
For bug reports, provide this information, please:
h2. What Debezium connector do you use and what version?
v3.2.0.Final
h2. What is the connector configuration?
{
"name": "db2-connector",
"config": {
"connector.class": "io.debezium.connector.db2.Db2Connector",
"database.hostname": "db2",
"database.port": "5001",
"database.user": "db2inst1",
"database.password": "123456",
"database.dbname": "testdb",
"topic.prefix": "employee",
"table.include.list": "DB2INST1.EMPLOYEE_SALARY",
"schema.history.internal.kafka.bootstrap.servers": "kafka:9092",
"schema.history.internal.kafka.topic": "schemahistory.employee"
}
}
h2. What is the captured database version and mode of deployment?
(E.g. on-premises, with a specific cloud provider, etc.)
DB2 v10.5
h2. What behavior do you expect?
create connector successfully.
h2. What behavior do you see?
there has an exception when I create a new connector on db2: "Invalid parameter: 0 is an invalid transaction isolation level. See Javadoc specification for a list of valid values. ERRORCODE=-4461, SQLSTATE=42815". I just checked the source code and found the root cause may be in src\main\java\io\debezium\connector\db2\Db2SnapshotChangeEventSource.java method close(SnapshotContext snapshotContext), in this method it will call jdbcConnection.connection().setTransactionIsolation(0), and in db2 the 0 value should be not supported(TRANSACTION_NONE), only Connection.TRANSACTION_READ_UNCOMMITTED, TRANSACTION_READ_COMMITTED, TRANSACTION_REPEATABLE_READ, TRANSACTION_SERIALIZABLE were supported in db2
h2. Do you see the same behaviour using the latest released Debezium version?
(Ideally, also verify with latest Alpha/Beta/CR version)
yes
h2. Do you have the connector logs, ideally from start till finish?
(You might be asked later to provide [DEBUG/TRACE|https://debezium.io/documentation/reference/stable/operations/logging.html] level log)
[https://debezium.zulipchat.com/user_uploads/38476/Ggqbm5lPLCmjjxeUPTrbSUpE/PastedText.txt]
h2. How to reproduce the issue using our [tutorial|https://github.com/debezium/debezium-examples/tree/main/tutorial] deployment?
can setup a db2 database, open the ASN mode and try to create a new connector
h1. Feature request or enhancement
For feature requests or enhancements, provide this information, please:
The Db2SnapshotContext.class was defined with
isolationLevelBeforeStart as 0 for default, maybe give another valid value should be better.
h2. Which use case/requirement will be addressed by the proposed feature?
h2. Implementation ideas (optional)
Contributor guide
Assessment
This issue has not been assessed yet.