Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions oracle-plugin/docs/Oracle-batchsink.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ You also can use the macro function ${conn(connection-name)}.

**Role** Login role of the user when connecting to the database. For eg, NORMAL, SYSDBA, SYSOPER, etc.

**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.
- Note: If the user role selected is SYSDBA or SYSOPER, the plugin will default to TRANSACTION_READ_COMMITTED to prevent ORA-08178 errors

**Connection Type** Whether to use an SID or Service Name when connecting to the database.

**SID/Service Name/TNS Connect Descriptor:** Oracle connection point (Database name, Service name, or a TNS Connect Descriptor). When using TNS, place
Expand Down
5 changes: 5 additions & 0 deletions oracle-plugin/docs/Oracle-batchsource.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ the full TNS Connect Descriptor in the text field. For example:

**Role** Login role of the user when connecting to the 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.
- Note: If the user role selected is SYSDBA or SYSOPER, the plugin will default to TRANSACTION_READ_COMMITTED to prevent ORA-08178 errors

**Import Query:** The SELECT query to use to import data from the specified table.
You can specify an arbitrary number of columns to import, or import all columns using \*. The Query should
contain the '$CONDITIONS' string. For example, 'SELECT * FROM table WHERE $CONDITIONS'.
Expand Down
5 changes: 5 additions & 0 deletions oracle-plugin/docs/Oracle-connector.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ the full TNS Connect Descriptor in the text field. For example:

**Role:** Login role of the user when connecting to the 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.
- Note: If the user role selected is SYSDBA or SYSOPER, the plugin will default to TRANSACTION_READ_COMMITTED to prevent ORA-08178 errors

**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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,12 @@ public String getConnectionString() {
@Macro
private String database;

@Name(OracleConstants.TRANSACTION_ISOLATION_LEVEL)
@Description("The transaction isolation level for the database session.")
@Macro
@Nullable
private String transactionIsolationLevel;

@Override
protected int getDefaultPort() {
return 1521;
Expand All @@ -105,10 +111,17 @@ public Properties getConnectionArgumentsProperties() {
prop.put(INTERNAL_LOGON_PROPERTY, getRole());
return prop;
}

public String getTransactionIsolationLevel() {
return ROLE_NORMAL.equals(getRole()) ? null :
TransactionIsolationLevel.Level.TRANSACTION_READ_COMMITTED.name();
//if null default to the highest isolation level possible
if (transactionIsolationLevel == null) {
transactionIsolationLevel = TransactionIsolationLevel.Level.TRANSACTION_SERIALIZABLE.name();
}
//To solve the problem of ORA-08178: illegal SERIALIZABLE clause specified for user INTERNAL
//This ensures that the role is mapped to the right serialization level, even w/ 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();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,5 @@ private OracleConstants() {
public static final String ROLE = "role";
public static final String NAME_DATABASE = "database";
public static final String TNS_CONNECTION_TYPE = "TNS";
public static final String TRANSACTION_ISOLATION_LEVEL = "transactionIsolationLevel";
}
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ public static class OracleSourceConfig extends AbstractDBSpecificSourceConfig {
@Nullable
@Description("Whether to use an existing connection.")
private Boolean useConnection;

@Name(NAME_CONNECTION)
@Macro
@Nullable
Expand Down Expand Up @@ -130,7 +131,7 @@ public void validate(FailureCollector collector) {

@Override
public String getTransactionIsolationLevel() {
Comment thread
jster1357 marked this conversation as resolved.
return getConnection().getTransactionIsolationLevel();
return connection.getTransactionIsolationLevel();
}
}

Expand Down
28 changes: 28 additions & 0 deletions oracle-plugin/widgets/Oracle-batchsink.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,18 @@
]
}
},
{
"widget-type": "select",
"label": "Transaction Isolation Level",
"name": "transactionIsolationLevel",
"widget-attributes": {
"values": [
"TRANSACTION_READ_COMMITTED",
"TRANSACTION_SERIALIZABLE"
],
"default": "TRANSACTION_SERIALIZABLE"
}
},
{
"name": "connectionType",
"label": "Connection Type",
Expand Down Expand Up @@ -179,6 +191,18 @@
],
"outputs": [],
"filters": [
{
"name": "showIsolationLevels",
"condition": {
"expression": "role == 'normal'"
},
"show": [
{
"type": "property",
"name": "transactionIsolationLevel"
}
]
},
{
"name": "showConnectionProperties ",
"condition": {
Expand Down Expand Up @@ -220,6 +244,10 @@
{
"type": "property",
"name": "database"
},
{
"type": "property",
"name": "transactionIsolationLevel"
}
]
},
Expand Down
28 changes: 28 additions & 0 deletions oracle-plugin/widgets/Oracle-batchsource.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,18 @@
]
}
},
{
"widget-type": "select",
"label": "Transaction Isolation Level",
"name": "transactionIsolationLevel",
"widget-attributes": {
"values": [
"TRANSACTION_READ_COMMITTED",
"TRANSACTION_SERIALIZABLE"
],
"default": "TRANSACTION_SERIALIZABLE"
}
},
{
"name": "connectionType",
"label": "Connection Type",
Expand Down Expand Up @@ -237,6 +249,18 @@
}
],
"filters": [
{
"name": "showIsolationLevels",
"condition": {
"expression": "role == 'normal'"
},
"show": [
{
"type": "property",
"name": "transactionIsolationLevel"
}
]
},
{
"name": "showConnectionProperties ",
"condition": {
Expand Down Expand Up @@ -278,6 +302,10 @@
{
"type": "property",
"name": "database"
},
{
"type": "property",
"name": "transactionIsolationLevel"
}
]
},
Expand Down
26 changes: 26 additions & 0 deletions oracle-plugin/widgets/Oracle-connector.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,18 @@
}
]
}
},
{
"widget-type": "select",
"label": "Transaction Isolation Level",
"name": "transactionIsolationLevel",
"widget-attributes": {
"values": [
"TRANSACTION_READ_COMMITTED",
"TRANSACTION_SERIALIZABLE"
],
"default": "TRANSACTION_SERIALIZABLE"
}
}
]
},
Expand All @@ -118,5 +130,19 @@
]
}
],
"filters" : [
{
"name": "showIsolationLevels",
"condition": {
"expression": "role == 'normal'"
},
"show": [
{
"type": "property",
"name": "transactionIsolationLevel"
}
]
}
],
"outputs": []
}