Uploaded image for project: 'Debezium'
  1. Debezium
  2. DBZ-6452

Refactor OracleConnection with PDB vs non-PDB

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Unresolved
    • Major
    • 2.3-backlog
    • None
    • oracle-connector
    • None
    • False
    • None
    • False

    Description

      In the changes introduced by DbZ-6254, there were some changes in the CommitLogWriterFlushStrategy that added several if-blocks to perform extra steps when the connector configuration defined database.pdb.name.

      Ideally, we should reconsider a refactor of the Oracle code base such that we pull this concern inside the OracleConnection class itself, and expose explicit methods on the connection class for various Oracle database interactions, i.e.:

      public void performCommitFlush(Scn scn) {
          executeInPdb("UPDATE <flush-table> SET SCN = " + scn);
      }
      
      public void executeInPdb(String query) {
          final OracleContainer container = getCurrentContainer();
          if (isMultitenancyEnabled() && !container.isPdb()) {
              setSessionToPdb();
          }
          execute(query);
          if (isMultiTenancyEnabled() && !container.isPdb()) {
              setSessionToRoot();
          }
      }
      

      The above code is a bit pseudo and introduces new methods and classes we don't yet have, but the idea is to clean this code and polish things to adhere to the following:

      1. The concept of Multitenancy vs Single Tenancy is encapsulated in OracleConnection.
      2. Ideally all SQL fragments should be managed in OracleConnection.

      This has the benefit to simplify not only the runtime code bits, but it should also help with the test suite dealing with different deployment configurations more easily.

      Attachments

        Activity

          People

            Unassigned Unassigned
            ccranfor@redhat.com Chris Cranford
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: