Start Transaction
AutomatR.OracleDB.Database.StartTransaction
The "Start Transaction" activity in AutomatR for Oracle databases initiates a transaction on the database. This activity is crucial for grouping a set of database operations into a single, atomic unit of work. The transaction can be committed or rolled back based on the success or failure of the enclosed database operations.
Properties
Name | Description |
---|---|
Input | |
Connection | Specifies an OracleConnection variable used to establish a connection to the database. This connection is used for the entire duration of the transaction. A variable of type OracleConnection should be provided. |
Misc | |
Display Name | Provides a customizable name for the activity displayed in the workflow. The display name enhances clarity and organization within the automation project. String variables containing the desired display name. |
Optional | |
Delay | Specifies the amount of time (in seconds) to wait before executing the "Start Transaction" activity. This can be useful for handling synchronization issues. Integer variables containing the delay duration. Ex.: If the amount of time is 1000 milliseconds or 1 sec, i.e., 1. |
How to use:
- Drag and drop the "Start Transaction" activity onto the workflow.
- Configure the properties by specifying the delay duration and providing an OracleConnection variable.
- Optionally, configure the delay and customize the display name.
- Place the database operations you want to include in the transaction within the "Start Transaction" activity. Connect them to the "Start Transaction" activity using the Sequence activity or other suitable activity containers.
- Execute the workflow to start the transaction and perform the enclosed database operations.
Note:
- The "Start Transaction" activity should enclose database operations that you want to be part of the same transaction. This ensures that either all operations are committed or none of them are, providing data consistency.
- Use the "Start Transaction" activity in conjunction with other database activities to perform operations like inserts, updates, or deletes within a transaction.
Example: Consider an example where the "Start Transaction" activity is used to encapsulate database operations:
Start Transaction:
Display Name: "Transaction Scope"
Delay: 2 seconds
Connection: oracleConnectionVariable
Sequence:
OracleDB Activity 1
OracleDB Activity 2
OracleDB Activity 3
In this example, the "Start Transaction" activity begins a transaction, and three database activities (Activity 1, Activity 2, and Activity 3) are executed within the transaction. If all three activities succeed, the transaction is committed. If any activity fails, the transaction is rolled back, ensuring data consistency.