-
Notifications
You must be signed in to change notification settings - Fork 0
Added TRANSACTION_ISOLATION_LEVEL in AbstractDBSpecificConnectorConfig #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from 10 commits
d75a03e
5da84da
144de23
3416985
8946d5e
8b01c44
085e047
4f77a05
178bfb5
4af4f5e
d6628b5
d7a8032
1cf173d
9874ebf
ed2c392
4b27a1b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,6 +20,7 @@ | |
| import io.cdap.cdap.api.annotation.Macro; | ||
| import io.cdap.cdap.api.annotation.Name; | ||
| import io.cdap.plugin.db.ConnectionConfig; | ||
| import io.cdap.plugin.db.TransactionIsolationLevel; | ||
|
|
||
| import java.util.Collections; | ||
| import java.util.Map; | ||
|
|
@@ -42,6 +43,13 @@ public abstract class AbstractDBSpecificConnectorConfig extends AbstractDBConnec | |
| @Nullable | ||
| protected Integer port; | ||
|
|
||
|
|
||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. remove blank line |
||
| @Name(ConnectionConfig.TRANSACTION_ISOLATION_LEVEL) | ||
| @Description("The transaction isolation level for the database session.") | ||
| @Macro | ||
| @Nullable | ||
| protected String transactionIsolationLevel; | ||
|
|
||
| public String getHost() { | ||
| return host; | ||
| } | ||
|
|
@@ -55,4 +63,11 @@ public int getPort() { | |
| public boolean canConnect() { | ||
| return super.canConnect() && !containsMacro(ConnectionConfig.HOST) && !containsMacro(ConnectionConfig.PORT); | ||
| } | ||
|
|
||
| public String getTransactionIsolationLevel() { | ||
| if (transactionIsolationLevel == null) { | ||
| transactionIsolationLevel = TransactionIsolationLevel.Level.TRANSACTION_READ_COMMITTED.name(); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
||
| } | ||
| return TransactionIsolationLevel.Level.valueOf(transactionIsolationLevel).name(); | ||
| } | ||
|
Comment on lines
+68
to
+86
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we set the |
||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,6 +22,12 @@ authentication. Optional for databases that do not require authentication. | |
|
|
||
| **Password:** Password to use to connect to the specified database. | ||
|
|
||
| **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. | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. https://dev.mysql.com/doc/refman/8.4/en/innodb-transaction-isolation-levels.html#isolevel_repeatable-read this is also not default for mysql There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is this we are making default on UI then its fine |
||
| - TRANSACTION_REPEATABLE_READ: No dirty reads. Prevents non-repeatable reads, but phantom reads are still possible. | ||
| - TRANSACTION_READ_UNCOMMITTED: Allows dirty reads (reading uncommitted changes from other transactions). Non-repeatable reads and phantom reads are possible. | ||
|
|
||
| **Connection Arguments:** A list of arbitrary string tag/value pairs as connection arguments. These arguments | ||
| will be passed to the JDBC driver, as connection arguments, for JDBC drivers that may need additional configurations. | ||
| This is a semicolon-separated list of key-value pairs, where each pair is separated by a equals '=' and specifies | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,6 +22,11 @@ authentication. Optional for databases that do not require authentication. | |
|
|
||
| **Password:** Password to use to connect to the specified database. | ||
|
|
||
| **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. | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| - TRANSACTION_REPEATABLE_READ: No dirty reads. Prevents non-repeatable reads, but phantom reads are still possible. | ||
|
|
||
| **Database:** The name of the database to connect to. | ||
|
|
||
| **Connection Arguments:** A list of arbitrary string tag/value pairs as connection arguments. These arguments | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused variable
ROLE?