Skip to content

Conversation

@Krish-cloudsufi
Copy link
Owner

@Krish-cloudsufi Krish-cloudsufi commented Apr 9, 2025

Added support for specifying the transaction isolation level in database plugins by introducing a new optional property "transactionIsolationLevel" in the AbstractDBSpecificConnectorConfig class — the parent class for MySQL, PostgreSQL, and Oracle connector configurations.

Screenshot from 2025-04-11 15-12-03

Comment on lines 68 to 72
if (transactionIsolationLevel == null) {
transactionIsolationLevel = TransactionIsolationLevel.Level.TRANSACTION_SERIALIZABLE.name();
}
return TransactionIsolationLevel.Level.valueOf(transactionIsolationLevel).name();
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we set the transactionIsolationLevel to TRANSACTION_READ_COMMITTED for normal roles just to ensure that the role is mapped to the right serialization level, even with incorrect user input?

//if role is SYSDBA or SYSOP it will map to read_committed. else serialized
    return (!getRole().equals(ROLE_NORMAL)) ? TransactionIsolationLevel.Level.TRANSACTION_READ_COMMITTED.name() :
            TransactionIsolationLevel.Level.valueOf(transactionIsolationLevel).name();

@sgarg-CS
Copy link
Collaborator

sgarg-CS commented Apr 11, 2025

@Krish-cloudsufi You'd also need to put the Transaction Isolation Level in the additional arguments for all affected DB plugins. See how it's done in Oracle Connector Configuration for reference.

@Nullable
protected Integer port;


Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove blank line


public String getTransactionIsolationLevel() {
if (transactionIsolationLevel == null) {
transactionIsolationLevel = TransactionIsolationLevel.Level.TRANSACTION_READ_COMMITTED.name();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in other plugins we dont have a default isolation level set by us as it can differ db wise, return null if it is null


**Transaction Isolation Level** The transaction isolation level of the databse connection
- TRANSACTION_READ_COMMITTED: No dirty reads. Non-repeatable reads and phantom reads are possible.
- TRANSACTION_SERIALIZABLE (default): No dirty reads. Non-repeatable and phantom reads are prevented.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


**Transaction Isolation Level** The transaction isolation level of the databse connection
- TRANSACTION_READ_COMMITTED: No dirty reads. Non-repeatable reads and phantom reads are possible.
- TRANSACTION_SERIALIZABLE (default): No dirty reads. Non-repeatable and phantom reads are prevented.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this we are making default on UI then its fine

public static final String JDBC_PLUGIN_NAME = "jdbcPluginName";
public static final String JDBC_PLUGIN_TYPE = "jdbc";
public static final String TRANSACTION_ISOLATION_LEVEL = "transactionIsolationLevel";
public static final String ROLE = "role";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused variable ROLE ?

}

public String getTransactionIsolationLevel() {
LOG.debug("Hi Krish Inside AbstractDBSpecificSourceConfig getTransactionIsolationLevel ");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this logger one testing is complete.

}

public Map<String, String> getAdditionalArguments() {
LOG.debug("inside get Additional argument of AbstractDBConnectorConfig");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove after testing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants