Skip to content

Commit

Permalink
DBZ-7516 Fix Reselect test failure, use enable table CDC callback
Browse files Browse the repository at this point in the history
  • Loading branch information
Naros authored and jpechane committed Feb 20, 2024
1 parent 2c03ec5 commit c624895
Showing 1 changed file with 19 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,19 @@ public void afterEach() throws Exception {
}
finally {
if (connection != null) {
TestHelper.disableDbCdc(connection);
TestHelper.disableTableCdc(connection, "DBZ4321");
connection.execute("DROP TABLE dbz4321");
try {
TestHelper.disableDbCdc(connection);
}
catch (Exception e) {
e.printStackTrace();
}
try {
TestHelper.disableTableCdc(connection, "DBZ4321");
}
catch (Exception e) {
e.printStackTrace();
}
connection.execute("DROP TABLE dbz4321 IF EXISTS");
connection.execute("DELETE FROM ASNCDC.IBMSNAP_REGISTER");
connection.execute("DELETE FROM ASNCDC.IBMQREP_COLVERSION");
connection.execute("DELETE FROM ASNCDC.IBMQREP_TABVERSION");
Expand Down Expand Up @@ -89,9 +99,6 @@ protected void createTable() throws Exception {
connection.execute("DROP TABLE DBZ4321 IF EXISTS");
TestHelper.enableDbCdc(connection);
connection.execute("CREATE TABLE DBZ4321 (id int not null, data varchar(50), data2 int, primary key(id))");
connection.execute("UPDATE ASNCDC.IBMSNAP_REGISTER SET STATE = 'A' WHERE SOURCE_OWNER = 'DB2INST1'");
TestHelper.refreshAndWait(connection);
TestHelper.enableTableCdc(connection, "DBZ4321");
}

@Override
Expand All @@ -118,4 +125,10 @@ protected String fieldName(String fieldName) {
return fieldName.toUpperCase();
}

@Override
protected void enableTableForCdc() throws Exception {
connection.execute("UPDATE ASNCDC.IBMSNAP_REGISTER SET STATE = 'A' WHERE SOURCE_OWNER = 'DB2INST1'");
TestHelper.refreshAndWait(connection);
TestHelper.enableTableCdc(connection, "DBZ4321");
}
}

0 comments on commit c624895

Please sign in to comment.