Details
-
Enhancement
-
Resolution: Unresolved
-
Major
-
None
-
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:
- The concept of Multitenancy vs Single Tenancy is encapsulated in OracleConnection.
- 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.